home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1997
/
MacHack 1997.toast
/
Hacks
/
Hacks ’96
/
PredatorPrey
/
calc_contents.c
< prev
next >
Wrap
Text File
|
1996-06-22
|
115KB
|
3,233 lines
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
/* */
/* Prototype HP15C Calculator */
/* James C. Ullrey */
/* INRESCO */
/* © 1990 */
/* Version 13.97a */
/* */
/* CONTENTS SEGMENT */
/* */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
/*****************************************************************/
/* I N C L U D E S
/*****************************************************************/
#ifndef __C14__
#include "PredatorPrey.h"
#endif
#include <Quickdraw.h>
#include "calc_dork.h"
#include "calc_contents.h"
#include "calc_update.h"
#include "calc_draw_object.h"
#include "ResourceDefs.h"
//#include "Bremermann.h"
//#define gray 0xFFFFFFE8
/*****************************************************************/
/* P R O T O T Y P E S
/*****************************************************************/
void deselect_objects (WindowPtr wPtr, Boolean delete_obj);
short point_in_object (WObjsHandle w_objs_hndl, Point the_point, short *n);
void select_group (WindowPtr wPtr, Rect *selectn_rect);
Boolean do_rubber_rect (Point old_pt, Rect *rbrband_rect);
void grow_objects (WindowPtr wPtr, Point mouse_pt);
void move_objects (WindowPtr wPtr, Point mouse_pt);
void draw_move_frames (WObjsHandle w_objs_hndl,
Point mouse_pt,
Point *net_move);
void draw_grow_frames (WObjsHandle w_objs_hndl,
Point mouse_pt,
Point *net_move);
void size_frames (WObjsHandle w_objs_hndl, Point frame_pt);
void do_get_rot_text ( WindowPtr wPtr);
void do_get_str_text ( WindowPtr wPtr);
/*****************************************************************/
/* G L O B A L V A R I A B L E D E C L A R A T I O N S
/*****************************************************************/
extern struct PredDataHndl;
extern Rect gArrow_box;
extern Rect gCircle_box;
extern Rect gSquare_box;
extern Rect gCube_box;
extern Rect gHouse_box;
extern Rect gBackGrnd_box;
extern Rect gPalette_frame;
extern Rect gRotation_frame;
extern Rect gMovement_frame;
extern Rect gPlaneControl_frame;
extern Rect gXrotation_box;
extern Rect gYrotation_box;
extern Rect gZrotation_box;
extern Rect gNegXrotation_box;
extern Rect gNegYrotation_box;
extern Rect gNegZrotation_box;
extern Rect gDoManyRotation_box;
extern Rect gDoRotateLeft_box;
extern Rect gDoRotateRight_box;
extern Rect gDoRotateUp_box;
extern Rect gDoRotateDown_box;
extern Rect gDoMoveIn_box;
extern Rect gDoMoveOut_box;
extern Rect gDoPitchUp_box;
extern Rect gDoPitchDn_box;
extern Rect gDoYawLft_box;
extern Rect gDoYawRt_box;
extern Rect gDoBankLft_box;
extern Rect gDoBankRt_box;
extern Rect gXrot_text_box;
extern Rect gYrot_text_box;
extern Rect gZrot_text_box;
extern Rect gRot_OK_box;
extern Rect gRot_Cancel_box;
extern Rect gStretch_frame;
extern Rect gXstretch_box;
extern Rect gYstretch_box;
extern Rect gZstretch_box;
extern Rect gNegXstretch_box;
extern Rect gNegYstretch_box;
extern Rect gNegZstretch_box;
extern Rect gXstr_text_box;
extern Rect gYstr_text_box;
extern Rect gZstr_text_box;
extern Rect gStr_OK_box;
extern Rect gStr_Cancel_box;
extern WindowPtr lastPtr;
/*****************************************************************/
/*****************************************************************/
/*
/* R O U T I N E S
/*
/*****************************************************************/
/*****************************************************************/
void contents_seg() {} /* for reference in "UnloadSeg()" calls */
/*****************************************************************/
/* D R A W C O N T E N T S
/*****************************************************************/
/* called from mousedown.c:HandleMouseDown() */
void draw_contents(WindowPtr wPtr,EventRecord *an_event)
{
short n, find_code;
long obj_type;
short weapons_type;
Point mouse_pt;
Rect rubber_rect;
RgnHandle saved_clip;
WObjsHandle w_objs_hndl;
short the_object;
Boolean spec;
spec = FALSE;
/********* Save the state of the machine & set up for our job here ******/
SetPort(wPtr);
saved_clip = NewRgn();
GetClip(saved_clip);
w_objs_hndl=(WObjs**)GetWRefCon(wPtr);
the_object = (**w_objs_hndl).paletteSetting;
/************* Handle mouse-clicks in the pallette **********/
mouse_pt = an_event->where; /* an_event.where ?? */
GlobalToLocal( &mouse_pt );
if((**w_objs_hndl).isPrey || the_object == PLOT_OBJ)
{
; /* do nothing */
}
else
{
clip_4_palette(wPtr);
if( PtInRect(mouse_pt, &gPalette_frame) )
{
if(PtInRect(mouse_pt,&gArrow_box)) obj_type = ARROW_OBJ;
else if(PtInRect(mouse_pt,&gCircle_box)) obj_type = CIRCLE_OBJ;
else if(PtInRect(mouse_pt,&gSquare_box)) obj_type = SQUARE_OBJ;
else if(PtInRect(mouse_pt,&gCube_box)) obj_type = CUBE_OBJ;
else if(PtInRect(mouse_pt,&gHouse_box)) obj_type = HOUSE_OBJ;
else if(PtInRect(mouse_pt,&gBackGrnd_box))
{
if (an_event->modifiers & cmdKey) obj_type = T_BACKGRND_OBJ;
else obj_type = BACKGRND_OBJ;
}
(**w_objs_hndl).paletteSetting = obj_type;
draw_palette(wPtr); /* in calc_update.c */
}
/***** If not in the pallette, select object(s) or draw a new object... ******/
else
{
obj_type = (**w_objs_hndl).paletteSetting;
if(obj_type == CIRCLE_OBJ) /* make a circle */
{
deselect_objects(wPtr, FALSE);
create_new_object(wPtr, mouse_pt, CIRCLE_OBJ);
}
else if(obj_type == SQUARE_OBJ) /* make a square */
{
deselect_objects(wPtr, FALSE);
create_new_object(wPtr, mouse_pt, SQUARE_OBJ);
}
else if(obj_type == CUBE_OBJ) /* make a cube */
{
deselect_objects(wPtr, FALSE);
create_new_object(wPtr, mouse_pt, CUBE_OBJ); /* this */
}
else if(obj_type == HOUSE_OBJ) /* make a house */
{
deselect_objects(wPtr, FALSE);
if (
(an_event->modifiers & optionKey)&&
(an_event->modifiers & controlKey)&&
(an_event->modifiers & cmdKey)
)
{
obj_type = ARMD_HOUSE3_OBJ; /* guns, missles & neutron bomb */
} /* ARMD_HOUSE3_OBJ = 8 */
else if (
(an_event->modifiers & cmdKey)&&
(an_event->modifiers & optionKey)
)
{
obj_type = ARMD_HOUSE2_OBJ; /* guns & missles */
} /* ARMD_HOUSE2_OBJ = 9 */
else if (an_event->modifiers & cmdKey)
{
obj_type = ARMD_HOUSE1_OBJ; /* guns */
} /* ARMD_HOUSE1_OBJ = 10 */
create_new_object(wPtr, mouse_pt, obj_type); /* this */
}
else if(obj_type == ARMD_HOUSE3_OBJ) /* make an armed house with guns, missles & thermonuclear device */
{
deselect_objects(wPtr, FALSE);
create_new_object(wPtr, mouse_pt, ARMD_HOUSE3_OBJ); /* this */
}
else if(obj_type == ARMD_HOUSE2_OBJ) /* make an armed house with guns & missles */
{
deselect_objects(wPtr, FALSE);
create_new_object(wPtr, mouse_pt, ARMD_HOUSE2_OBJ); /* this */
}
else if(obj_type == ARMD_HOUSE1_OBJ) /* make an armed house with guns */
{
deselect_objects(wPtr, FALSE);
create_new_object(wPtr, mouse_pt, ARMD_HOUSE1_OBJ); /* this */
}
else if(obj_type == BACKGRND_OBJ) /* make background */
{
deselect_objects(wPtr, FALSE);
if((**w_objs_hndl).hasBackGround == FALSE)
{
if (an_event->modifiers & cmdKey) obj_type = T_BACKGRND_OBJ;
else obj_type = BACKGRND_OBJ; /* T_BACKGRND_OBJ = 11 */
create_new_object(wPtr, mouse_pt, obj_type); /* this */
(**w_objs_hndl).hasBackGround = TRUE;
}
}
else if(obj_type == T_BACKGRND_OBJ) /* make background */
{
deselect_objects(wPtr, FALSE);
if((**w_objs_hndl).hasBackGround == FALSE)
{
create_new_object(wPtr, mouse_pt, T_BACKGRND_OBJ); /* this */
(**w_objs_hndl).hasBackGround = TRUE;
}
}
else if(obj_type == ARROW_OBJ) /* select or move or grow */
{
find_code = point_in_object(w_objs_hndl, mouse_pt, &n);
if(find_code == NO_OBJ) /* if not in an object, do rubber rectangle */
{
if((an_event->modifiers & shiftKey) == 0)
deselect_objects(wPtr, FALSE);
do_rubber_rect(mouse_pt, &rubber_rect);
select_group(wPtr, &rubber_rect);
}
else
{
if(find_code == NON_SELECTED) /* if in an object, select it */
{
if((an_event->modifiers & shiftKey) == 0) /* Shift key down? */
deselect_objects(wPtr, FALSE); /* no, de-select others. */
(**w_objs_hndl).object[n].selected = TRUE; /* set this one selected */
draw_object(wPtr, n, spec); /* re-draw it "selected" */
move_objects(wPtr, mouse_pt); /* allow "select & grab" */
}
else if(find_code == GROW_BOX) /* if in grow box, grow it */
grow_objects(wPtr, mouse_pt);
else if(find_code == SELECTED) /* if in a selected object, move it */
move_objects(wPtr, mouse_pt); /* this */
}
} /* end of palette setting = ARROW_OBJ */
}
}
/********* Flag the window as "dirty" (changed) ************/
/***
Almost every operation through here will change the window contents,
although there are some exceptions: a rubber-band selection that
includes no objects, a palette-click that doesn't change the tool
selection, etc. For simplicty we always flag "dirty" but strictly
speaking it would be better to check the details...
***/
(**w_objs_hndl).dirty = TRUE;
/********* Restore the state of the machine ******************/
SetClip(saved_clip);
DisposeRgn(saved_clip);
return;
} /* end of draw_contents() */
/*****************************************************************/
/* C R E A T E N E W O B J E C T - set wobjs record info & draw new objects
/*****************************************************************/
/**
This routine finds an empty entry for an object in the WObjs record, sets
the contents of that entry to reflect an object of the type specified,
then calls for the object to be drawn
**/
void create_new_object(WindowPtr wPtr,Point mouse_pt,short type)
{
short m,n,i,j,k;
short rLeft,rTop,rRight,rBottom;
short zBase = 0;
double_t yy,zz;
short xx,limit;
Point offset;
Rect object_rect;
WObjsHandle w_objs_hndl;
Boolean spec;
OSErr iErr;
PredDataHndl pred_hndl;
spec = FALSE;
w_objs_hndl = (WObjsHandle)GetWRefCon(wPtr);
offset = (**w_objs_hndl).scrollAmount;
if(type != BACKGRND_OBJ) /* BACKGRND_OBJ = 7 */
{
if(type != T_BACKGRND_OBJ) /* T_BACKGRND_OBJ = 11 */
{
n = 0;
while ( ((**w_objs_hndl).object[n].type != NO_OBJ) && (n < MAX_OBJECTS)) n++;
if (n >= MAX_OBJECTS) return; /* no room.... */
}
else n = MAX_OBJECTS + 2; /* MAX_OBJECTS = 30 */
}
else n = MAX_OBJECTS + 2; /* MAX_OBJECTS = 30 */
if(type == HOUSE_OBJ)
{
if ((mouse_pt.h < HSE_OBJ_SIZE) /* HSE_OBJ_SIZE = 40 */
|| (mouse_pt.h > (**w_objs_hndl).hDocLimit - HSE_OBJ_SIZE - offset.h)
|| (mouse_pt.v < HSE_OBJ_SIZE)
|| (mouse_pt.v > (**w_objs_hndl).vDocLimit - HSE_OBJ_SIZE - offset.v)) return;
/* if click point would cause the house to be drawn overlapping the boundry, don't draw it */
}
if(type == ARMD_HOUSE3_OBJ || type == ARMD_HOUSE2_OBJ || type == ARMD_HOUSE1_OBJ )
{
if ((mouse_pt.h < A_HSE_OBJ_SIZE) /* A_HSE_OBJ_SIZE = 40 */
|| (mouse_pt.h > (**w_objs_hndl).hDocLimit - A_HSE_OBJ_SIZE - offset.h)
|| (mouse_pt.v < A_HSE_OBJ_SIZE)
|| (mouse_pt.v > (**w_objs_hndl).vDocLimit - A_HSE_OBJ_SIZE - offset.v)) return;
/* if click point would cause the house to be drawn overlapping the boundry, don't draw it */
}
else if(type == BACKGRND_OBJ) /* 7 */
{
;
}
else if(type == T_BACKGRND_OBJ) /* 11 */
{
;
}
else
{
if ((mouse_pt.h < OBJECT_SIZE)
|| (mouse_pt.h > (**w_objs_hndl).hDocLimit - OBJECT_SIZE - offset.h)
|| (mouse_pt.v < OBJECT_SIZE)
|| (mouse_pt.v > (**w_objs_hndl).vDocLimit - OBJECT_SIZE - offset.v)) return;
}
if(type == HOUSE_OBJ) /* 5 */
{
(**w_objs_hndl).object[n].armed = FALSE;
rLeft = offset.h + mouse_pt.h - HSE_OBJ_SIZE;
rTop = offset.v + mouse_pt.v - HSE_OBJ_SIZE;
rRight = offset.h + mouse_pt.h + HSE_OBJ_SIZE;
rBottom = offset.v + mouse_pt.v + HSE_OBJ_SIZE;
}
else if(type == BACKGRND_OBJ)
{
;
}
else if(type == T_BACKGRND_OBJ)
{
(**w_objs_hndl).hasTargets = TRUE;
(**w_objs_hndl).targets_left = 6;
if((**w_objs_hndl).isPrey == 1) ; else draw_palette(wPtr);
}
else if(type == ARMD_HOUSE3_OBJ || type == ARMD_HOUSE2_OBJ || type == ARMD_HOUSE1_OBJ )
{
if((**w_objs_hndl).isArmed == TRUE) return;
else
{
(**w_objs_hndl).isArmed = TRUE;
(**w_objs_hndl).object[n].armed = TRUE;
(**w_objs_hndl).object[n].missles = 14;
for(i = 0;i<=9;i++)
{
(**w_objs_hndl).object[n].sndStruct[i].Chan00 = (SndChannelPtr)NewPtrClear(sizeof(SndChannel));
if((**w_objs_hndl).object[n].sndStruct[i].Chan00 != nil)
{
(**w_objs_hndl).object[n].sndStruct[i].Chan00->qLength = stdQLength;
iErr = SndNewChannel(&(**w_objs_hndl).object[n].sndStruct[i].Chan00,sampledSynth,initMono,nil);
}
}
switch(type)
{
case ARMD_HOUSE3_OBJ: /* 8 */
(**w_objs_hndl).armament_type = 2; /* guns, missles & thermonuclear device */
break;
case ARMD_HOUSE2_OBJ: /* 9 */
(**w_objs_hndl).armament_type = 1; /* guns & missles */
break;
case ARMD_HOUSE1_OBJ: /* 10 */
(**w_objs_hndl).armament_type = 0; /* guns */
break;
}
(**w_objs_hndl).arms_selected = 0;
draw_palette(wPtr); /* in calc_update.c */
type = HOUSE_OBJ;
rLeft = offset.h + mouse_pt.h - HSE_OBJ_SIZE;
rTop = offset.v + mouse_pt.v - HSE_OBJ_SIZE;
rRight = offset.h + mouse_pt.h + HSE_OBJ_SIZE;
rBottom = offset.v + mouse_pt.v + HSE_OBJ_SIZE;
}
}
else if(type == BARBIE) /* 12 */
{
// set object size for Barbie
}
else if(type == KEN) /* 13 */
{
// set object size for Ken
rLeft = offset.h + mouse_pt.h - OBJECT_SIZE; /* OBJECT_SIZE = 25 */
rTop = offset.v + mouse_pt.v - OBJECT_SIZE;
rRight = offset.h + mouse_pt.h + OBJECT_SIZE;
rBottom = offset.v + mouse_pt.v + OBJECT_SIZE;
}
else
{
rLeft = offset.h + mouse_pt.h - OBJECT_SIZE; /* OBJECT_SIZE = 25 */
rTop = offset.v + mouse_pt.v - OBJECT_SIZE;
rRight = offset.h + mouse_pt.h + OBJECT_SIZE;
rBottom = offset.v + mouse_pt.v + OBJECT_SIZE;
}
if(type != BACKGRND_OBJ)
{
if(type != T_BACKGRND_OBJ)
{
SetRect(&object_rect, rLeft, rTop, rRight+1, rBottom+1);
(**w_objs_hndl).object[n].type = type;
(**w_objs_hndl).object[n].bounds = object_rect;
(**w_objs_hndl).object[n].selected = TRUE;
}
}
if(type == CUBE_OBJ)
{
for(i = 0; i <=7; i++)
{
(**w_objs_hndl).object[n]._3dPt[i].no_point = 1;
}
/************* set vertices *************/
(**w_objs_hndl).object[n]._3dPt[0].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPt[0].y_point = rTop;
(**w_objs_hndl).object[n]._3dPt[0].z_point = zBase - OBJECT_SIZE;
(**w_objs_hndl).object[n]._3dPt[1].x_point = rRight;
(**w_objs_hndl).object[n]._3dPt[1].y_point = rTop;
(**w_objs_hndl).object[n]._3dPt[1].z_point = zBase - OBJECT_SIZE;
(**w_objs_hndl).object[n]._3dPt[2].x_point = rRight;
(**w_objs_hndl).object[n]._3dPt[2].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPt[2].z_point = zBase - OBJECT_SIZE;
(**w_objs_hndl).object[n]._3dPt[3].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPt[3].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPt[3].z_point = zBase - OBJECT_SIZE;
(**w_objs_hndl).object[n]._3dPt[4].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPt[4].y_point = rTop;
(**w_objs_hndl).object[n]._3dPt[4].z_point = zBase + OBJECT_SIZE;
(**w_objs_hndl).object[n]._3dPt[5].x_point = rRight;
(**w_objs_hndl).object[n]._3dPt[5].y_point = rTop;
(**w_objs_hndl).object[n]._3dPt[5].z_point = zBase + OBJECT_SIZE;
(**w_objs_hndl).object[n]._3dPt[6].x_point = rRight;
(**w_objs_hndl).object[n]._3dPt[6].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPt[6].z_point = zBase + OBJECT_SIZE;
(**w_objs_hndl).object[n]._3dPt[7].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPt[7].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPt[7].z_point = zBase + OBJECT_SIZE;
/****** set vertices for posterity ******/
(**w_objs_hndl).object[n]._3dPtH[0].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPtH[0].y_point = rTop;
(**w_objs_hndl).object[n]._3dPtH[0].z_point = zBase - OBJECT_SIZE;
(**w_objs_hndl).object[n]._3dPtH[1].x_point = rRight;
(**w_objs_hndl).object[n]._3dPtH[1].y_point = rTop;
(**w_objs_hndl).object[n]._3dPtH[1].z_point = zBase - OBJECT_SIZE;
(**w_objs_hndl).object[n]._3dPtH[2].x_point = rRight;
(**w_objs_hndl).object[n]._3dPtH[2].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPtH[2].z_point = zBase - OBJECT_SIZE;
(**w_objs_hndl).object[n]._3dPtH[3].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPtH[3].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPtH[3].z_point = zBase - OBJECT_SIZE;
(**w_objs_hndl).object[n]._3dPtH[4].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPtH[4].y_point = rTop;
(**w_objs_hndl).object[n]._3dPtH[4].z_point = zBase + OBJECT_SIZE;
(**w_objs_hndl).object[n]._3dPtH[5].x_point = rRight;
(**w_objs_hndl).object[n]._3dPtH[5].y_point = rTop;
(**w_objs_hndl).object[n]._3dPtH[5].z_point = zBase + OBJECT_SIZE;
(**w_objs_hndl).object[n]._3dPtH[6].x_point = rRight;
(**w_objs_hndl).object[n]._3dPtH[6].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPtH[6].z_point = zBase + OBJECT_SIZE;
(**w_objs_hndl).object[n]._3dPtH[7].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPtH[7].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPtH[7].z_point = zBase + OBJECT_SIZE;
/** initialize rotation history matrix **/
for(i = 0;i <=3;i++)
{
for(j = 0;j <= 3;j++)
{
if(i == j)
{
(**w_objs_hndl).object[n].rotHist[i][j].rotElem = 1;
}
else
{
(**w_objs_hndl).object[n].rotHist[i][j].rotElem = 0;
}
}
}
}
else if(type == KEN)
{
/* for(i = 0; i <= 38; i++)*/
/* {*/
/* (**w_objs_hndl).object[n]._3dPt[i].no_point = 1;*/
/* }*/
/* /************* set vertices ************»*/
/* */
/* (**w_objs_hndl).object[n]._3dPt[0].x_point = rLeft;*/
/* (**w_objs_hndl).object[n]._3dPt[0].y_point = rBottom;*/
/* (**w_objs_hndl).object[n]._3dPt[0].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/* */
/* (**w_objs_hndl).object[n]._3dPt[1].x_point = rLeft;*/
/* (**w_objs_hndl).object[n]._3dPt[1].y_point = rBottom - 50;*/
/* (**w_objs_hndl).object[n]._3dPt[1].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/* */
/* (**w_objs_hndl).object[n]._3dPt[2].x_point = offset.h + mouse_pt.h;*/
/* (**w_objs_hndl).object[n]._3dPt[2].y_point = rTop;*/
/* (**w_objs_hndl).object[n]._3dPt[2].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[3].x_point = rRight;*/
/* (**w_objs_hndl).object[n]._3dPt[3].y_point = rBottom - 50;*/
/* (**w_objs_hndl).object[n]._3dPt[3].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[4].x_point = rRight;*/
/* (**w_objs_hndl).object[n]._3dPt[4].y_point = rBottom;*/
/* (**w_objs_hndl).object[n]._3dPt[4].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[5].x_point = offset.h + mouse_pt.h + 10;*/
/* (**w_objs_hndl).object[n]._3dPt[5].y_point = rBottom;*/
/* (**w_objs_hndl).object[n]._3dPt[5].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[6].x_point = offset.h + mouse_pt.h + 10;*/
/* (**w_objs_hndl).object[n]._3dPt[6].y_point = rBottom - 35;*/
/* (**w_objs_hndl).object[n]._3dPt[6].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[7].x_point = offset.h + mouse_pt.h - 10;*/
/* (**w_objs_hndl).object[n]._3dPt[7].y_point = rBottom - 35;*/
/* (**w_objs_hndl).object[n]._3dPt[7].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[8].x_point = offset.h + mouse_pt.h - 10;*/
/* (**w_objs_hndl).object[n]._3dPt[8].y_point = rBottom;*/
/* (**w_objs_hndl).object[n]._3dPt[8].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[9].x_point = rLeft;*/
/* (**w_objs_hndl).object[n]._3dPt[9].y_point = rBottom;*/
/* (**w_objs_hndl).object[n]._3dPt[9].z_point = zBase + HSE_OBJ_SIZE + 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[10].x_point = rLeft;*/
/* (**w_objs_hndl).object[n]._3dPt[10].y_point = rBottom - 50;*/
/* (**w_objs_hndl).object[n]._3dPt[10].z_point = zBase + HSE_OBJ_SIZE + 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[11].x_point = offset.h + mouse_pt.h;*/
/* (**w_objs_hndl).object[n]._3dPt[11].y_point = rTop;*/
/* (**w_objs_hndl).object[n]._3dPt[11].z_point = zBase + HSE_OBJ_SIZE + 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[12].x_point = rRight;*/
/* (**w_objs_hndl).object[n]._3dPt[12].y_point = rBottom - 50;*/
/* (**w_objs_hndl).object[n]._3dPt[12].z_point = zBase + HSE_OBJ_SIZE + 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[13].x_point = rRight;*/
/* (**w_objs_hndl).object[n]._3dPt[13].y_point = rBottom;*/
/* (**w_objs_hndl).object[n]._3dPt[13].z_point = zBase + HSE_OBJ_SIZE + 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[14].x_point = rLeft;*/
/* (**w_objs_hndl).object[n]._3dPt[14].y_point = rBottom - 15;*/
/* (**w_objs_hndl).object[n]._3dPt[14].z_point = zBase - 25;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[15].x_point = rLeft;*/
/* (**w_objs_hndl).object[n]._3dPt[15].y_point = rBottom - 30;*/
/* (**w_objs_hndl).object[n]._3dPt[15].z_point = zBase - 25;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[16].x_point = rLeft;*/
/* (**w_objs_hndl).object[n]._3dPt[16].y_point = rBottom - 30;*/
/* (**w_objs_hndl).object[n]._3dPt[16].z_point = zBase + 15;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[17].x_point = rLeft;*/
/* (**w_objs_hndl).object[n]._3dPt[17].y_point = rBottom - 15;*/
/* (**w_objs_hndl).object[n]._3dPt[17].z_point = zBase + 15;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[18].x_point = offset.h + mouse_pt.h - 10;*/
/* (**w_objs_hndl).object[n]._3dPt[18].y_point = rBottom - 40;*/
/* (**w_objs_hndl).object[n]._3dPt[18].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[19].x_point = offset.h + mouse_pt.h - 10;*/
/* (**w_objs_hndl).object[n]._3dPt[19].y_point = rBottom - 45;*/
/* (**w_objs_hndl).object[n]._3dPt[19].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[20].x_point = offset.h + mouse_pt.h - 15;*/
/* (**w_objs_hndl).object[n]._3dPt[20].y_point = rBottom - 35;*/
/* (**w_objs_hndl).object[n]._3dPt[20].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[21].x_point = offset.h + mouse_pt.h - 20;*/
/* (**w_objs_hndl).object[n]._3dPt[21].y_point = rBottom - 35;*/
/* (**w_objs_hndl).object[n]._3dPt[21].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[22].x_point = rRight;*/
/* (**w_objs_hndl).object[n]._3dPt[22].y_point = rBottom - 50;*/
/* (**w_objs_hndl).object[n]._3dPt[22].z_point = zBase + HSE_OBJ_SIZE + 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[23].x_point = rRight;*/
/* (**w_objs_hndl).object[n]._3dPt[23].y_point = rBottom;*/
/* (**w_objs_hndl).object[n]._3dPt[23].z_point = zBase + HSE_OBJ_SIZE + 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[24].x_point = rLeft;*/
/* (**w_objs_hndl).object[n]._3dPt[24].y_point = rBottom - 15;*/
/* (**w_objs_hndl).object[n]._3dPt[24].z_point = zBase - 25;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[25].x_point = rLeft;*/
/* (**w_objs_hndl).object[n]._3dPt[25].y_point = rBottom - 30;*/
/* (**w_objs_hndl).object[n]._3dPt[25].z_point = zBase - 25;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[26].x_point = rLeft;*/
/* (**w_objs_hndl).object[n]._3dPt[26].y_point = rBottom - 30;*/
/* (**w_objs_hndl).object[n]._3dPt[26].z_point = zBase + 15;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[27].x_point = rLeft;*/
/* (**w_objs_hndl).object[n]._3dPt[27].y_point = rBottom - 15;*/
/* (**w_objs_hndl).object[n]._3dPt[27].z_point = zBase + 15;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[28].x_point = offset.h + mouse_pt.h - 10;*/
/* (**w_objs_hndl).object[n]._3dPt[28].y_point = rBottom - 40;*/
/* (**w_objs_hndl).object[n]._3dPt[28].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[29].x_point = offset.h + mouse_pt.h - 10;*/
/* (**w_objs_hndl).object[n]._3dPt[29].y_point = rBottom - 45;*/
/* (**w_objs_hndl).object[n]._3dPt[29].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[30].x_point = offset.h + mouse_pt.h - 15;*/
/* (**w_objs_hndl).object[n]._3dPt[30].y_point = rBottom - 35;*/
/* (**w_objs_hndl).object[n]._3dPt[30].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[31].x_point = offset.h + mouse_pt.h - 20;*/
/* (**w_objs_hndl).object[n]._3dPt[31].y_point = rBottom - 35;*/
/* (**w_objs_hndl).object[n]._3dPt[31].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[32].x_point = rRight;*/
/* (**w_objs_hndl).object[n]._3dPt[32].y_point = rBottom - 50;*/
/* (**w_objs_hndl).object[n]._3dPt[32].z_point = zBase + HSE_OBJ_SIZE + 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[33].x_point = rRight;*/
/* (**w_objs_hndl).object[n]._3dPt[33].y_point = rBottom;*/
/* (**w_objs_hndl).object[n]._3dPt[33].z_point = zBase + HSE_OBJ_SIZE + 5;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[34].x_point = rLeft;*/
/* (**w_objs_hndl).object[n]._3dPt[34].y_point = rBottom - 15;*/
/* (**w_objs_hndl).object[n]._3dPt[34].z_point = zBase - 25;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[35].x_point = rLeft;*/
/* (**w_objs_hndl).object[n]._3dPt[35].y_point = rBottom - 30;*/
/* (**w_objs_hndl).object[n]._3dPt[35].z_point = zBase - 25;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[36].x_point = rLeft;*/
/* (**w_objs_hndl).object[n]._3dPt[36].y_point = rBottom - 30;*/
/* (**w_objs_hndl).object[n]._3dPt[36].z_point = zBase + 15;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[37].x_point = rLeft;*/
/* (**w_objs_hndl).object[n]._3dPt[37].y_point = rBottom - 15;*/
/* (**w_objs_hndl).object[n]._3dPt[37].z_point = zBase + 15;*/
/**/
/* (**w_objs_hndl).object[n]._3dPt[38].x_point = offset.h + mouse_pt.h - 10;*/
/* (**w_objs_hndl).object[n]._3dPt[38].y_point = rBottom - 40;*/
/* (**w_objs_hndl).object[n]._3dPt[38].z_point = zBase - HSE_OBJ_SIZE - 5;*/
/**/
/* /****** set vertices for posterity *****»*/
/* */
/**/
/* /** initialize rotation history matrix *»*/
/**/
/* for(i = 0;i <=3;i++)*/
/* {*/
/* for(j = 0;j <= 3;j++)*/
/* {*/
/* if(i == j)*/
/* {*/
/* (**w_objs_hndl).object[n].rotHist[i][j].rotElem = 1;*/
/* }*/
/* else*/
/* {*/
/* (**w_objs_hndl).object[n].rotHist[i][j].rotElem = 0;*/
/* } */
/* }*/
/* } */
}
else if( type == HOUSE_OBJ )
{
for(i = 0; i <= 21; i++)
{
(**w_objs_hndl).object[n]._3dPt[i].no_point = 1;
}
/************* set vertices *************/
(**w_objs_hndl).object[n]._3dPt[0].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPt[0].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPt[0].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPt[1].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPt[1].y_point = rBottom - 50;
(**w_objs_hndl).object[n]._3dPt[1].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPt[2].x_point = offset.h + mouse_pt.h;
(**w_objs_hndl).object[n]._3dPt[2].y_point = rTop;
(**w_objs_hndl).object[n]._3dPt[2].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPt[3].x_point = rRight;
(**w_objs_hndl).object[n]._3dPt[3].y_point = rBottom - 50;
(**w_objs_hndl).object[n]._3dPt[3].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPt[4].x_point = rRight;
(**w_objs_hndl).object[n]._3dPt[4].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPt[4].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPt[5].x_point = offset.h + mouse_pt.h + 10;
(**w_objs_hndl).object[n]._3dPt[5].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPt[5].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPt[6].x_point = offset.h + mouse_pt.h + 10;
(**w_objs_hndl).object[n]._3dPt[6].y_point = rBottom - 35;
(**w_objs_hndl).object[n]._3dPt[6].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPt[7].x_point = offset.h + mouse_pt.h - 10;
(**w_objs_hndl).object[n]._3dPt[7].y_point = rBottom - 35;
(**w_objs_hndl).object[n]._3dPt[7].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPt[8].x_point = offset.h + mouse_pt.h - 10;
(**w_objs_hndl).object[n]._3dPt[8].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPt[8].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPt[9].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPt[9].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPt[9].z_point = zBase + HSE_OBJ_SIZE + 5;
(**w_objs_hndl).object[n]._3dPt[10].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPt[10].y_point = rBottom - 50;
(**w_objs_hndl).object[n]._3dPt[10].z_point = zBase + HSE_OBJ_SIZE + 5;
(**w_objs_hndl).object[n]._3dPt[11].x_point = offset.h + mouse_pt.h;
(**w_objs_hndl).object[n]._3dPt[11].y_point = rTop;
(**w_objs_hndl).object[n]._3dPt[11].z_point = zBase + HSE_OBJ_SIZE + 5;
(**w_objs_hndl).object[n]._3dPt[12].x_point = rRight;
(**w_objs_hndl).object[n]._3dPt[12].y_point = rBottom - 50;
(**w_objs_hndl).object[n]._3dPt[12].z_point = zBase + HSE_OBJ_SIZE + 5;
(**w_objs_hndl).object[n]._3dPt[13].x_point = rRight;
(**w_objs_hndl).object[n]._3dPt[13].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPt[13].z_point = zBase + HSE_OBJ_SIZE + 5;
(**w_objs_hndl).object[n]._3dPt[14].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPt[14].y_point = rBottom - 15;
(**w_objs_hndl).object[n]._3dPt[14].z_point = zBase - 25;
(**w_objs_hndl).object[n]._3dPt[15].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPt[15].y_point = rBottom - 30;
(**w_objs_hndl).object[n]._3dPt[15].z_point = zBase - 25;
(**w_objs_hndl).object[n]._3dPt[16].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPt[16].y_point = rBottom - 30;
(**w_objs_hndl).object[n]._3dPt[16].z_point = zBase + 15;
(**w_objs_hndl).object[n]._3dPt[17].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPt[17].y_point = rBottom - 15;
(**w_objs_hndl).object[n]._3dPt[17].z_point = zBase + 15;
(**w_objs_hndl).object[n]._3dPt[18].x_point = offset.h + mouse_pt.h - 10;
(**w_objs_hndl).object[n]._3dPt[18].y_point = rBottom - 40;
(**w_objs_hndl).object[n]._3dPt[18].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPt[19].x_point = offset.h + mouse_pt.h - 10;
(**w_objs_hndl).object[n]._3dPt[19].y_point = rBottom - 45;
(**w_objs_hndl).object[n]._3dPt[19].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPt[20].x_point = offset.h + mouse_pt.h - 15;
(**w_objs_hndl).object[n]._3dPt[20].y_point = rBottom - 35;
(**w_objs_hndl).object[n]._3dPt[20].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPt[21].x_point = offset.h + mouse_pt.h - 20;
(**w_objs_hndl).object[n]._3dPt[21].y_point = rBottom - 35;
(**w_objs_hndl).object[n]._3dPt[21].z_point = zBase - HSE_OBJ_SIZE - 5;
/****** set vertices for posterity ******/
(**w_objs_hndl).object[n]._3dPtH[0].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPtH[0].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPtH[0].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPtH[1].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPtH[1].y_point = rBottom - 50;
(**w_objs_hndl).object[n]._3dPtH[1].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPtH[2].x_point = offset.h + mouse_pt.h;
(**w_objs_hndl).object[n]._3dPtH[2].y_point = rTop;
(**w_objs_hndl).object[n]._3dPtH[2].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPtH[3].x_point = rRight;
(**w_objs_hndl).object[n]._3dPtH[3].y_point = rBottom - 50;
(**w_objs_hndl).object[n]._3dPtH[3].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPtH[4].x_point = rRight;
(**w_objs_hndl).object[n]._3dPtH[4].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPtH[4].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPtH[5].x_point = offset.h + mouse_pt.h + 10;
(**w_objs_hndl).object[n]._3dPtH[5].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPtH[5].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPtH[6].x_point = offset.h + mouse_pt.h + 10;
(**w_objs_hndl).object[n]._3dPtH[6].y_point = rBottom - 35;
(**w_objs_hndl).object[n]._3dPtH[6].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPtH[7].x_point = offset.h + mouse_pt.h - 10;
(**w_objs_hndl).object[n]._3dPtH[7].y_point = rBottom - 35;
(**w_objs_hndl).object[n]._3dPtH[7].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPtH[8].x_point = offset.h + mouse_pt.h - 10;
(**w_objs_hndl).object[n]._3dPtH[8].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPtH[8].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPtH[9].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPtH[9].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPtH[9].z_point = zBase + HSE_OBJ_SIZE + 5;
(**w_objs_hndl).object[n]._3dPtH[10].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPtH[10].y_point = rBottom - 50;
(**w_objs_hndl).object[n]._3dPtH[10].z_point = zBase + HSE_OBJ_SIZE + 5;
(**w_objs_hndl).object[n]._3dPtH[11].x_point = offset.h + mouse_pt.h;
(**w_objs_hndl).object[n]._3dPtH[11].y_point = rTop;
(**w_objs_hndl).object[n]._3dPtH[11].z_point = zBase + HSE_OBJ_SIZE + 5;
(**w_objs_hndl).object[n]._3dPtH[12].x_point = rRight;
(**w_objs_hndl).object[n]._3dPtH[12].y_point = rBottom - 50;
(**w_objs_hndl).object[n]._3dPtH[12].z_point = zBase + HSE_OBJ_SIZE + 5;
(**w_objs_hndl).object[n]._3dPtH[13].x_point = rRight;
(**w_objs_hndl).object[n]._3dPtH[13].y_point = rBottom;
(**w_objs_hndl).object[n]._3dPtH[13].z_point = zBase + HSE_OBJ_SIZE + 5;
(**w_objs_hndl).object[n]._3dPtH[14].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPtH[14].y_point = rBottom - 15;
(**w_objs_hndl).object[n]._3dPtH[14].z_point = zBase - 25;
(**w_objs_hndl).object[n]._3dPtH[15].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPtH[15].y_point = rBottom - 30;
(**w_objs_hndl).object[n]._3dPtH[15].z_point = zBase - 25;
(**w_objs_hndl).object[n]._3dPtH[16].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPtH[16].y_point = rBottom - 30;
(**w_objs_hndl).object[n]._3dPtH[16].z_point = zBase + 15;
(**w_objs_hndl).object[n]._3dPtH[17].x_point = rLeft;
(**w_objs_hndl).object[n]._3dPtH[17].y_point = rBottom - 15;
(**w_objs_hndl).object[n]._3dPtH[17].z_point = zBase + 15;
(**w_objs_hndl).object[n]._3dPtH[18].x_point = offset.h + mouse_pt.h - 10;
(**w_objs_hndl).object[n]._3dPtH[18].y_point = rBottom - 40;
(**w_objs_hndl).object[n]._3dPtH[18].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPtH[19].x_point = offset.h + mouse_pt.h - 10;
(**w_objs_hndl).object[n]._3dPtH[19].y_point = rBottom - 45;
(**w_objs_hndl).object[n]._3dPtH[19].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPtH[20].x_point = offset.h + mouse_pt.h - 15;
(**w_objs_hndl).object[n]._3dPtH[20].y_point = rBottom - 35;
(**w_objs_hndl).object[n]._3dPtH[20].z_point = zBase - HSE_OBJ_SIZE - 5;
(**w_objs_hndl).object[n]._3dPtH[21].x_point = offset.h + mouse_pt.h - 20;
(**w_objs_hndl).object[n]._3dPtH[21].y_point = rBottom - 35;
(**w_objs_hndl).object[n]._3dPtH[21].z_point = zBase - HSE_OBJ_SIZE - 5;
/** initialize rotation history matrix **/
for(i = 0;i <=3;i++)
{
for(j = 0;j <= 3;j++)
{
if(i == j)
{
(**w_objs_hndl).object[n].rotHist[i][j].rotElem = 1;
}
else
{
(**w_objs_hndl).object[n].rotHist[i][j].rotElem = 0;
}
}
}
/* //if(PreyMenu != NIL)*/
/* {*/
/* pred_hndl = (predDataHndl)NewHandle(sizeof(predData));*/
/* (**pred_hndl).object[1] = (**w_objs_hndl).object[n];*/
/* (**pred_hndl).type = type;*/
/* (**pred_hndl).hasBackGround = (**w_objs_hndl).hasBackGround;*/
/* (**pred_hndl).isArmed = (**w_objs_hndl).isArmed;*/
/* (**pred_hndl).targets_left = (**w_objs_hndl).targets_left;*/
/* (**pred_hndl).armament_type = (**w_objs_hndl).armament_type;*/
/* (**pred_hndl).arms_selected = (**w_objs_hndl).arms_selected;*/
/* (**pred_hndl).hasTargets = (**w_objs_hndl).hasTargets;*/
/* }*/
}
else if(type == BACKGRND_OBJ || type == T_BACKGRND_OBJ)
{
/************* set vertices *************/
(**w_objs_hndl).bg_object[0]._3dPt_BG[0].x_point = 500; /* first tetrahedron */
(**w_objs_hndl).bg_object[0]._3dPt_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[0]._3dPt_BG[0].z_point = - 500;
(**w_objs_hndl).bg_object[0]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[0]._3dPt_BG[1].x_point = 540;
(**w_objs_hndl).bg_object[0]._3dPt_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[0]._3dPt_BG[1].z_point = -480;
(**w_objs_hndl).bg_object[0]._3dPt_BG[1].no_point = 1;
(**w_objs_hndl).bg_object[0]._3dPt_BG[2].x_point = 560;
(**w_objs_hndl).bg_object[0]._3dPt_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[0]._3dPt_BG[2].z_point = -520;
(**w_objs_hndl).bg_object[0]._3dPt_BG[2].no_point = 1;
(**w_objs_hndl).bg_object[0]._3dPt_BG[3].x_point = 530;
(**w_objs_hndl).bg_object[0]._3dPt_BG[3].y_point = 170;
(**w_objs_hndl).bg_object[0]._3dPt_BG[3].z_point = -500;
(**w_objs_hndl).bg_object[0]._3dPt_BG[3].no_point = 1;
(**w_objs_hndl).bg_object[0].z_reg = -500;
(**w_objs_hndl).bg_object[0].max_pts = 4;
(**w_objs_hndl).bg_object[1]._3dPt_BG[0].x_point = 580; /* second tetrahedron */
(**w_objs_hndl).bg_object[1]._3dPt_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[1]._3dPt_BG[0].z_point = -470;
(**w_objs_hndl).bg_object[1]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[1]._3dPt_BG[1].x_point = 620;
(**w_objs_hndl).bg_object[1]._3dPt_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[1]._3dPt_BG[1].z_point = -460;
(**w_objs_hndl).bg_object[1]._3dPt_BG[1].no_point = 1;
(**w_objs_hndl).bg_object[1]._3dPt_BG[2].x_point = 640;
(**w_objs_hndl).bg_object[1]._3dPt_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[1]._3dPt_BG[2].z_point = -490;
(**w_objs_hndl).bg_object[1]._3dPt_BG[2].no_point = 1;
(**w_objs_hndl).bg_object[1]._3dPt_BG[3].x_point = 610;
(**w_objs_hndl).bg_object[1]._3dPt_BG[3].y_point = 170;
(**w_objs_hndl).bg_object[1]._3dPt_BG[3].z_point = -470;
(**w_objs_hndl).bg_object[1]._3dPt_BG[3].no_point = 1;
(**w_objs_hndl).bg_object[1].z_reg = -470;
(**w_objs_hndl).bg_object[1].max_pts = 4;
(**w_objs_hndl).bg_object[2]._3dPt_BG[0].x_point = 660; /* third tetrahedron */
(**w_objs_hndl).bg_object[2]._3dPt_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[2]._3dPt_BG[0].z_point = -440;
(**w_objs_hndl).bg_object[2]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[2]._3dPt_BG[1].x_point = 700;
(**w_objs_hndl).bg_object[2]._3dPt_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[2]._3dPt_BG[1].z_point = -420;
(**w_objs_hndl).bg_object[2]._3dPt_BG[1].no_point = 1;
(**w_objs_hndl).bg_object[2]._3dPt_BG[2].x_point = 720;
(**w_objs_hndl).bg_object[2]._3dPt_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[2]._3dPt_BG[2].z_point = -460;
(**w_objs_hndl).bg_object[2]._3dPt_BG[2].no_point = 1;
(**w_objs_hndl).bg_object[2]._3dPt_BG[3].x_point = 690;
(**w_objs_hndl).bg_object[2]._3dPt_BG[3].y_point = 170;
(**w_objs_hndl).bg_object[2]._3dPt_BG[3].z_point = -440;
(**w_objs_hndl).bg_object[2]._3dPt_BG[3].no_point = 1;
(**w_objs_hndl).bg_object[2].z_reg = -440;
(**w_objs_hndl).bg_object[2].max_pts = 4;
(**w_objs_hndl).bg_object[3]._3dPt_BG[0].x_point = -200; /* first column */
(**w_objs_hndl).bg_object[3]._3dPt_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[3]._3dPt_BG[0].z_point = -100;
(**w_objs_hndl).bg_object[3]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[3]._3dPt_BG[1].x_point = -160;
(**w_objs_hndl).bg_object[3]._3dPt_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[3]._3dPt_BG[1].z_point = -100;
(**w_objs_hndl).bg_object[3]._3dPt_BG[1].no_point = 1;
(**w_objs_hndl).bg_object[3]._3dPt_BG[2].x_point = -160;
(**w_objs_hndl).bg_object[3]._3dPt_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[3]._3dPt_BG[2].z_point = -140;
(**w_objs_hndl).bg_object[3]._3dPt_BG[2].no_point = 1;
(**w_objs_hndl).bg_object[3]._3dPt_BG[3].x_point = -200;
(**w_objs_hndl).bg_object[3]._3dPt_BG[3].y_point = 200;
(**w_objs_hndl).bg_object[3]._3dPt_BG[3].z_point = -140;
(**w_objs_hndl).bg_object[3]._3dPt_BG[3].no_point = 1;
(**w_objs_hndl).bg_object[3]._3dPt_BG[4].x_point = -200;
(**w_objs_hndl).bg_object[3]._3dPt_BG[4].y_point = 100;
(**w_objs_hndl).bg_object[3]._3dPt_BG[4].z_point = -100;
(**w_objs_hndl).bg_object[3]._3dPt_BG[4].no_point = 1;
(**w_objs_hndl).bg_object[3]._3dPt_BG[5].x_point = -160;
(**w_objs_hndl).bg_object[3]._3dPt_BG[5].y_point = 100;
(**w_objs_hndl).bg_object[3]._3dPt_BG[5].z_point = -100;
(**w_objs_hndl).bg_object[3]._3dPt_BG[5].no_point = 1;
(**w_objs_hndl).bg_object[3]._3dPt_BG[6].x_point = -160;
(**w_objs_hndl).bg_object[3]._3dPt_BG[6].y_point = 100;
(**w_objs_hndl).bg_object[3]._3dPt_BG[6].z_point = -140;
(**w_objs_hndl).bg_object[3]._3dPt_BG[6].no_point = 1;
(**w_objs_hndl).bg_object[3]._3dPt_BG[7].x_point = -200;
(**w_objs_hndl).bg_object[3]._3dPt_BG[7].y_point = 100;
(**w_objs_hndl).bg_object[3]._3dPt_BG[7].z_point = -140;
(**w_objs_hndl).bg_object[3]._3dPt_BG[7].no_point = 1;
(**w_objs_hndl).bg_object[3].z_reg = -100;
(**w_objs_hndl).bg_object[3].max_pts = 8;
(**w_objs_hndl).bg_object[4]._3dPt_BG[0].x_point = -100; /* second column */
(**w_objs_hndl).bg_object[4]._3dPt_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[4]._3dPt_BG[0].z_point = -80;
(**w_objs_hndl).bg_object[4]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[4]._3dPt_BG[1].x_point = -60;
(**w_objs_hndl).bg_object[4]._3dPt_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[4]._3dPt_BG[1].z_point = -80;
(**w_objs_hndl).bg_object[4]._3dPt_BG[1].no_point = 1;
(**w_objs_hndl).bg_object[4]._3dPt_BG[2].x_point = -60;
(**w_objs_hndl).bg_object[4]._3dPt_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[4]._3dPt_BG[2].z_point = -120;
(**w_objs_hndl).bg_object[4]._3dPt_BG[2].no_point = 1;
(**w_objs_hndl).bg_object[4]._3dPt_BG[3].x_point = -100;
(**w_objs_hndl).bg_object[4]._3dPt_BG[3].y_point = 200;
(**w_objs_hndl).bg_object[4]._3dPt_BG[3].z_point = -120;
(**w_objs_hndl).bg_object[4]._3dPt_BG[3].no_point = 1;
(**w_objs_hndl).bg_object[4]._3dPt_BG[4].x_point = -100;
(**w_objs_hndl).bg_object[4]._3dPt_BG[4].y_point = 100;
(**w_objs_hndl).bg_object[4]._3dPt_BG[4].z_point = -80;
(**w_objs_hndl).bg_object[4]._3dPt_BG[4].no_point = 1;
(**w_objs_hndl).bg_object[4]._3dPt_BG[5].x_point = -60;
(**w_objs_hndl).bg_object[4]._3dPt_BG[5].y_point = 130;
(**w_objs_hndl).bg_object[4]._3dPt_BG[5].z_point = -80;
(**w_objs_hndl).bg_object[4]._3dPt_BG[5].no_point = 1;
(**w_objs_hndl).bg_object[4]._3dPt_BG[6].x_point = -60;
(**w_objs_hndl).bg_object[4]._3dPt_BG[6].y_point = 130;
(**w_objs_hndl).bg_object[4]._3dPt_BG[6].z_point = -120;
(**w_objs_hndl).bg_object[4]._3dPt_BG[6].no_point = 1;
(**w_objs_hndl).bg_object[4]._3dPt_BG[7].x_point = -100;
(**w_objs_hndl).bg_object[4]._3dPt_BG[7].y_point = 100;
(**w_objs_hndl).bg_object[4]._3dPt_BG[7].z_point = -120;
(**w_objs_hndl).bg_object[4]._3dPt_BG[7].no_point = 1;
(**w_objs_hndl).bg_object[4].z_reg = -80;
(**w_objs_hndl).bg_object[4].max_pts = 8;
(**w_objs_hndl).bg_object[5]._3dPt_BG[0].x_point = 0; /* third column */
(**w_objs_hndl).bg_object[5]._3dPt_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[5]._3dPt_BG[0].z_point = -60;
(**w_objs_hndl).bg_object[5]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[5]._3dPt_BG[1].x_point = 40;
(**w_objs_hndl).bg_object[5]._3dPt_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[5]._3dPt_BG[1].z_point = -60;
(**w_objs_hndl).bg_object[5]._3dPt_BG[1].no_point = 1;
(**w_objs_hndl).bg_object[5]._3dPt_BG[2].x_point = 40;
(**w_objs_hndl).bg_object[5]._3dPt_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[5]._3dPt_BG[2].z_point = -100;
(**w_objs_hndl).bg_object[5]._3dPt_BG[2].no_point = 1;
(**w_objs_hndl).bg_object[5]._3dPt_BG[3].x_point = 0;
(**w_objs_hndl).bg_object[5]._3dPt_BG[3].y_point = 200;
(**w_objs_hndl).bg_object[5]._3dPt_BG[3].z_point = -100;
(**w_objs_hndl).bg_object[5]._3dPt_BG[3].no_point = 1;
(**w_objs_hndl).bg_object[5]._3dPt_BG[4].x_point = 0;
(**w_objs_hndl).bg_object[5]._3dPt_BG[4].y_point = 130;
(**w_objs_hndl).bg_object[5]._3dPt_BG[4].z_point = -60;
(**w_objs_hndl).bg_object[5]._3dPt_BG[4].no_point = 1;
(**w_objs_hndl).bg_object[5]._3dPt_BG[5].x_point = 40;
(**w_objs_hndl).bg_object[5]._3dPt_BG[5].y_point = 130;
(**w_objs_hndl).bg_object[5]._3dPt_BG[5].z_point = -60;
(**w_objs_hndl).bg_object[5]._3dPt_BG[5].no_point = 1;
(**w_objs_hndl).bg_object[5]._3dPt_BG[6].x_point = 40;
(**w_objs_hndl).bg_object[5]._3dPt_BG[6].y_point = 100;
(**w_objs_hndl).bg_object[5]._3dPt_BG[6].z_point = -100;
(**w_objs_hndl).bg_object[5]._3dPt_BG[6].no_point = 1;
(**w_objs_hndl).bg_object[5]._3dPt_BG[7].x_point = 0;
(**w_objs_hndl).bg_object[5]._3dPt_BG[7].y_point = 100;
(**w_objs_hndl).bg_object[5]._3dPt_BG[7].z_point = -100;
(**w_objs_hndl).bg_object[5]._3dPt_BG[7].no_point = 1;
(**w_objs_hndl).bg_object[5].z_reg = -60;
(**w_objs_hndl).bg_object[5].max_pts = 8;
(**w_objs_hndl).bg_object[6]._3dPt_BG[0].x_point = 100; /* first cube */
(**w_objs_hndl).bg_object[6]._3dPt_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[6]._3dPt_BG[0].z_point = 120;
(**w_objs_hndl).bg_object[6]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[6]._3dPt_BG[1].x_point = 140;
(**w_objs_hndl).bg_object[6]._3dPt_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[6]._3dPt_BG[1].z_point = 120;
(**w_objs_hndl).bg_object[6]._3dPt_BG[1].no_point = 1;
(**w_objs_hndl).bg_object[6]._3dPt_BG[2].x_point = 140;
(**w_objs_hndl).bg_object[6]._3dPt_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[6]._3dPt_BG[2].z_point = 80;
(**w_objs_hndl).bg_object[6]._3dPt_BG[2].no_point = 1;
(**w_objs_hndl).bg_object[6]._3dPt_BG[3].x_point = 100;
(**w_objs_hndl).bg_object[6]._3dPt_BG[3].y_point = 200;
(**w_objs_hndl).bg_object[6]._3dPt_BG[3].z_point = 80;
(**w_objs_hndl).bg_object[6]._3dPt_BG[3].no_point = 1;
(**w_objs_hndl).bg_object[6]._3dPt_BG[4].x_point = 100;
(**w_objs_hndl).bg_object[6]._3dPt_BG[4].y_point = 160;
(**w_objs_hndl).bg_object[6]._3dPt_BG[4].z_point = 120;
(**w_objs_hndl).bg_object[6]._3dPt_BG[4].no_point = 1;
(**w_objs_hndl).bg_object[6]._3dPt_BG[5].x_point = 140;
(**w_objs_hndl).bg_object[6]._3dPt_BG[5].y_point = 150;
(**w_objs_hndl).bg_object[6]._3dPt_BG[5].z_point = 120;
(**w_objs_hndl).bg_object[6]._3dPt_BG[5].no_point = 1;
(**w_objs_hndl).bg_object[6]._3dPt_BG[6].x_point = 140;
(**w_objs_hndl).bg_object[6]._3dPt_BG[6].y_point = 160;
(**w_objs_hndl).bg_object[6]._3dPt_BG[6].z_point = 80;
(**w_objs_hndl).bg_object[6]._3dPt_BG[6].no_point = 1;
(**w_objs_hndl).bg_object[6]._3dPt_BG[7].x_point = 100;
(**w_objs_hndl).bg_object[6]._3dPt_BG[7].y_point = 170;
(**w_objs_hndl).bg_object[6]._3dPt_BG[7].z_point = 80;
(**w_objs_hndl).bg_object[6]._3dPt_BG[7].no_point = 1;
(**w_objs_hndl).bg_object[6].z_reg = 120;
(**w_objs_hndl).bg_object[6].max_pts = 8;
(**w_objs_hndl).bg_object[7]._3dPt_BG[0].x_point = 160; /* second cube */
(**w_objs_hndl).bg_object[7]._3dPt_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[7]._3dPt_BG[0].z_point = 180;
(**w_objs_hndl).bg_object[7]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[7]._3dPt_BG[1].x_point = 200;
(**w_objs_hndl).bg_object[7]._3dPt_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[7]._3dPt_BG[1].z_point = 180;
(**w_objs_hndl).bg_object[7]._3dPt_BG[1].no_point = 1;
(**w_objs_hndl).bg_object[7]._3dPt_BG[2].x_point = 200;
(**w_objs_hndl).bg_object[7]._3dPt_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[7]._3dPt_BG[2].z_point = 140;
(**w_objs_hndl).bg_object[7]._3dPt_BG[2].no_point = 1;
(**w_objs_hndl).bg_object[7]._3dPt_BG[3].x_point = 160;
(**w_objs_hndl).bg_object[7]._3dPt_BG[3].y_point = 200;
(**w_objs_hndl).bg_object[7]._3dPt_BG[3].z_point = 140;
(**w_objs_hndl).bg_object[7]._3dPt_BG[3].no_point = 1;
(**w_objs_hndl).bg_object[7]._3dPt_BG[4].x_point = 160;
(**w_objs_hndl).bg_object[7]._3dPt_BG[4].y_point = 160;
(**w_objs_hndl).bg_object[7]._3dPt_BG[4].z_point = 180;
(**w_objs_hndl).bg_object[7]._3dPt_BG[4].no_point = 1;
(**w_objs_hndl).bg_object[7]._3dPt_BG[5].x_point = 200;
(**w_objs_hndl).bg_object[7]._3dPt_BG[5].y_point = 160;
(**w_objs_hndl).bg_object[7]._3dPt_BG[5].z_point = 180;
(**w_objs_hndl).bg_object[7]._3dPt_BG[5].no_point = 1;
(**w_objs_hndl).bg_object[7]._3dPt_BG[6].x_point = 200;
(**w_objs_hndl).bg_object[7]._3dPt_BG[6].y_point = 160;
(**w_objs_hndl).bg_object[7]._3dPt_BG[6].z_point = 140;
(**w_objs_hndl).bg_object[7]._3dPt_BG[6].no_point = 1;
(**w_objs_hndl).bg_object[7]._3dPt_BG[7].x_point = 160;
(**w_objs_hndl).bg_object[7]._3dPt_BG[7].y_point = 160;
(**w_objs_hndl).bg_object[7]._3dPt_BG[7].z_point = 140;
(**w_objs_hndl).bg_object[7]._3dPt_BG[7].no_point = 1;
(**w_objs_hndl).bg_object[7].z_reg = 180;
(**w_objs_hndl).bg_object[7].max_pts = 8;
(**w_objs_hndl).bg_object[8]._3dPt_BG[0].x_point = 200; /* third cube */
(**w_objs_hndl).bg_object[8]._3dPt_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[8]._3dPt_BG[0].z_point = -180;
(**w_objs_hndl).bg_object[8]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[8]._3dPt_BG[1].x_point = 280;
(**w_objs_hndl).bg_object[8]._3dPt_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[8]._3dPt_BG[1].z_point = -180;
(**w_objs_hndl).bg_object[8]._3dPt_BG[1].no_point = 1;
(**w_objs_hndl).bg_object[8]._3dPt_BG[2].x_point = 280;
(**w_objs_hndl).bg_object[8]._3dPt_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[8]._3dPt_BG[2].z_point = -240;
(**w_objs_hndl).bg_object[8]._3dPt_BG[2].no_point = 1;
(**w_objs_hndl).bg_object[8]._3dPt_BG[3].x_point = 200;
(**w_objs_hndl).bg_object[8]._3dPt_BG[3].y_point = 200;
(**w_objs_hndl).bg_object[8]._3dPt_BG[3].z_point = -240;
(**w_objs_hndl).bg_object[8]._3dPt_BG[3].no_point = 1;
(**w_objs_hndl).bg_object[8]._3dPt_BG[4].x_point = 200;
(**w_objs_hndl).bg_object[8]._3dPt_BG[4].y_point = 160;
(**w_objs_hndl).bg_object[8]._3dPt_BG[4].z_point = -180;
(**w_objs_hndl).bg_object[8]._3dPt_BG[4].no_point = 1;
(**w_objs_hndl).bg_object[8]._3dPt_BG[5].x_point = 280;
(**w_objs_hndl).bg_object[8]._3dPt_BG[5].y_point = 160;
(**w_objs_hndl).bg_object[8]._3dPt_BG[5].z_point = -180;
(**w_objs_hndl).bg_object[8]._3dPt_BG[5].no_point = 1;
(**w_objs_hndl).bg_object[8]._3dPt_BG[6].x_point = 280;
(**w_objs_hndl).bg_object[8]._3dPt_BG[6].y_point = 160;
(**w_objs_hndl).bg_object[8]._3dPt_BG[6].z_point = -240;
(**w_objs_hndl).bg_object[8]._3dPt_BG[6].no_point = 1;
(**w_objs_hndl).bg_object[8]._3dPt_BG[7].x_point = 200;
(**w_objs_hndl).bg_object[8]._3dPt_BG[7].y_point = 160;
(**w_objs_hndl).bg_object[8]._3dPt_BG[7].z_point = -240;
(**w_objs_hndl).bg_object[8]._3dPt_BG[7].no_point = 1;
(**w_objs_hndl).bg_object[8].z_reg = -180;
(**w_objs_hndl).bg_object[8].max_pts = 8;
(**w_objs_hndl).bg_object[9]._3dPt_BG[0].x_point = 300; /* fourth cube */
(**w_objs_hndl).bg_object[9]._3dPt_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[9]._3dPt_BG[0].z_point = -480;
(**w_objs_hndl).bg_object[9]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[9]._3dPt_BG[1].x_point = 380;
(**w_objs_hndl).bg_object[9]._3dPt_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[9]._3dPt_BG[1].z_point = -480;
(**w_objs_hndl).bg_object[9]._3dPt_BG[1].no_point = 1;
(**w_objs_hndl).bg_object[9]._3dPt_BG[2].x_point = 380;
(**w_objs_hndl).bg_object[9]._3dPt_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[9]._3dPt_BG[2].z_point = -540;
(**w_objs_hndl).bg_object[9]._3dPt_BG[2].no_point = 1;
(**w_objs_hndl).bg_object[9]._3dPt_BG[3].x_point = 300;
(**w_objs_hndl).bg_object[9]._3dPt_BG[3].y_point = 200;
(**w_objs_hndl).bg_object[9]._3dPt_BG[3].z_point = -540;
(**w_objs_hndl).bg_object[9]._3dPt_BG[3].no_point = 1;
(**w_objs_hndl).bg_object[9]._3dPt_BG[4].x_point = 300;
(**w_objs_hndl).bg_object[9]._3dPt_BG[4].y_point = 160;
(**w_objs_hndl).bg_object[9]._3dPt_BG[4].z_point = -480;
(**w_objs_hndl).bg_object[9]._3dPt_BG[4].no_point = 1;
(**w_objs_hndl).bg_object[9]._3dPt_BG[5].x_point = 380;
(**w_objs_hndl).bg_object[9]._3dPt_BG[5].y_point = 160;
(**w_objs_hndl).bg_object[9]._3dPt_BG[5].z_point = -480;
(**w_objs_hndl).bg_object[9]._3dPt_BG[5].no_point = 1;
(**w_objs_hndl).bg_object[9]._3dPt_BG[6].x_point = 380;
(**w_objs_hndl).bg_object[9]._3dPt_BG[6].y_point = 160;
(**w_objs_hndl).bg_object[9]._3dPt_BG[6].z_point = -540;
(**w_objs_hndl).bg_object[9]._3dPt_BG[6].no_point = 1;
(**w_objs_hndl).bg_object[9]._3dPt_BG[7].x_point = 300;
(**w_objs_hndl).bg_object[9]._3dPt_BG[7].y_point = 160;
(**w_objs_hndl).bg_object[9]._3dPt_BG[7].z_point = -540;
(**w_objs_hndl).bg_object[9]._3dPt_BG[7].no_point = 1;
(**w_objs_hndl).bg_object[9].z_reg = -480;
(**w_objs_hndl).bg_object[9].max_pts = 8;
(**w_objs_hndl).bg_object[10]._3dPt_BG[0].x_point = 490; /* first triangle */
(**w_objs_hndl).bg_object[10]._3dPt_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[10]._3dPt_BG[0].z_point = 200;
(**w_objs_hndl).bg_object[10]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[10]._3dPt_BG[1].x_point = 690;
(**w_objs_hndl).bg_object[10]._3dPt_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[10]._3dPt_BG[1].z_point = 200;
(**w_objs_hndl).bg_object[10]._3dPt_BG[1].no_point = 1;
(**w_objs_hndl).bg_object[10]._3dPt_BG[2].x_point = 590;
(**w_objs_hndl).bg_object[10]._3dPt_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[10]._3dPt_BG[2].z_point = 30;
(**w_objs_hndl).bg_object[10]._3dPt_BG[2].no_point = 1;
(**w_objs_hndl).bg_object[10].z_reg = 200;
(**w_objs_hndl).bg_object[10].max_pts = 3;
(**w_objs_hndl).bg_object[11]._3dPt_BG[0].x_point = 10; /* second triangle */
(**w_objs_hndl).bg_object[11]._3dPt_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[11]._3dPt_BG[0].z_point = 200;
(**w_objs_hndl).bg_object[11]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[11]._3dPt_BG[1].x_point = 210;
(**w_objs_hndl).bg_object[11]._3dPt_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[11]._3dPt_BG[1].z_point = 200;
(**w_objs_hndl).bg_object[11]._3dPt_BG[1].no_point = 1;
(**w_objs_hndl).bg_object[11]._3dPt_BG[2].x_point = 110;
(**w_objs_hndl).bg_object[11]._3dPt_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[11]._3dPt_BG[2].z_point = 30;
(**w_objs_hndl).bg_object[11]._3dPt_BG[2].no_point = 1;
(**w_objs_hndl).bg_object[11].z_reg = 200;
(**w_objs_hndl).bg_object[11].max_pts = 3;
(**w_objs_hndl).bg_object[12]._3dPt_BG[0].x_point = 250; /* third triangle */
(**w_objs_hndl).bg_object[12]._3dPt_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[12]._3dPt_BG[0].z_point = 200;
(**w_objs_hndl).bg_object[12]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[12]._3dPt_BG[1].x_point = 450;
(**w_objs_hndl).bg_object[12]._3dPt_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[12]._3dPt_BG[1].z_point = 200;
(**w_objs_hndl).bg_object[12]._3dPt_BG[1].no_point = 1;
(**w_objs_hndl).bg_object[12]._3dPt_BG[2].x_point = 350;
(**w_objs_hndl).bg_object[12]._3dPt_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[12]._3dPt_BG[2].z_point = 30;
(**w_objs_hndl).bg_object[12]._3dPt_BG[2].no_point = 1;
(**w_objs_hndl).bg_object[12].z_reg = 200;
(**w_objs_hndl).bg_object[12].max_pts = 3;
(**w_objs_hndl).bg_object[13]._3dPt_BG[0].x_point = 490; /* fourth triangle */
(**w_objs_hndl).bg_object[13]._3dPt_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[13]._3dPt_BG[0].z_point = -30;
(**w_objs_hndl).bg_object[13]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[13]._3dPt_BG[1].x_point = 690;
(**w_objs_hndl).bg_object[13]._3dPt_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[13]._3dPt_BG[1].z_point = -30;
(**w_objs_hndl).bg_object[13]._3dPt_BG[1].no_point = 1;
(**w_objs_hndl).bg_object[13]._3dPt_BG[2].x_point = 590;
(**w_objs_hndl).bg_object[13]._3dPt_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[13]._3dPt_BG[2].z_point = -200;
(**w_objs_hndl).bg_object[13]._3dPt_BG[2].no_point = 1;
(**w_objs_hndl).bg_object[13].z_reg = -30;
(**w_objs_hndl).bg_object[13].max_pts = 3;
(**w_objs_hndl).bg_object[14]._3dPt_BG[0].x_point = 10; /* fifth triangle */
(**w_objs_hndl).bg_object[14]._3dPt_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[14]._3dPt_BG[0].z_point = -30;
(**w_objs_hndl).bg_object[14]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[14]._3dPt_BG[1].x_point = 210;
(**w_objs_hndl).bg_object[14]._3dPt_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[14]._3dPt_BG[1].z_point = -30;
(**w_objs_hndl).bg_object[14]._3dPt_BG[1].no_point = 1;
(**w_objs_hndl).bg_object[14]._3dPt_BG[2].x_point = 110;
(**w_objs_hndl).bg_object[14]._3dPt_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[14]._3dPt_BG[2].z_point = -200;
(**w_objs_hndl).bg_object[14]._3dPt_BG[2].no_point = 1;
(**w_objs_hndl).bg_object[14].z_reg = -30;
(**w_objs_hndl).bg_object[14].max_pts = 3;
(**w_objs_hndl).bg_object[15]._3dPt_BG[0].x_point = 250; /* sixth triangle */
(**w_objs_hndl).bg_object[15]._3dPt_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[15]._3dPt_BG[0].z_point = -30;
(**w_objs_hndl).bg_object[15]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[15]._3dPt_BG[1].x_point = 450;
(**w_objs_hndl).bg_object[15]._3dPt_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[15]._3dPt_BG[1].z_point = -30;
(**w_objs_hndl).bg_object[15]._3dPt_BG[1].no_point = 1;
(**w_objs_hndl).bg_object[15]._3dPt_BG[2].x_point = 350;
(**w_objs_hndl).bg_object[15]._3dPt_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[15]._3dPt_BG[2].z_point = -200;
(**w_objs_hndl).bg_object[15]._3dPt_BG[2].no_point = 1;
(**w_objs_hndl).bg_object[15].z_reg = -30;
(**w_objs_hndl).bg_object[15].max_pts = 3;
if(type == T_BACKGRND_OBJ)
{
GetPoint(&xx,&yy,&zz);
(**w_objs_hndl).bg_object[16]._3dPt_BG[0].x_point = xx; /* first calculator */
(**w_objs_hndl).bg_object[16]._3dPt_BG[0].y_point = yy;
(**w_objs_hndl).bg_object[16]._3dPt_BG[0].z_point = zz;
(**w_objs_hndl).bg_object[16]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[16]._3dPtH_BG[0].x_point = xx;
(**w_objs_hndl).bg_object[16]._3dPtH_BG[0].y_point = yy;
(**w_objs_hndl).bg_object[16]._3dPtH_BG[0].z_point = zz;
(**w_objs_hndl).bg_object[16]._3dPtH_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[16].z_reg = zz;
(**w_objs_hndl).bg_object[16].max_pts = 1;
(**w_objs_hndl).bg_object[16].alive = TRUE;
GetPoint(&xx,&yy,&zz);
(**w_objs_hndl).bg_object[17]._3dPt_BG[0].x_point = xx; /* second calculator */
(**w_objs_hndl).bg_object[17]._3dPt_BG[0].y_point = yy;
(**w_objs_hndl).bg_object[17]._3dPt_BG[0].z_point = zz;
(**w_objs_hndl).bg_object[17]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[17]._3dPtH_BG[0].x_point = xx;
(**w_objs_hndl).bg_object[17]._3dPtH_BG[0].y_point = yy;
(**w_objs_hndl).bg_object[17]._3dPtH_BG[0].z_point = zz;
(**w_objs_hndl).bg_object[17]._3dPtH_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[17].z_reg = zz;
(**w_objs_hndl).bg_object[17].max_pts = 1;
(**w_objs_hndl).bg_object[17].alive = TRUE;
GetPoint(&xx,&yy,&zz);
(**w_objs_hndl).bg_object[18]._3dPt_BG[0].x_point = xx; /* third calculator */
(**w_objs_hndl).bg_object[18]._3dPt_BG[0].y_point = yy;
(**w_objs_hndl).bg_object[18]._3dPt_BG[0].z_point = zz;
(**w_objs_hndl).bg_object[18]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[18]._3dPtH_BG[0].x_point = xx;
(**w_objs_hndl).bg_object[18]._3dPtH_BG[0].y_point = yy;
(**w_objs_hndl).bg_object[18]._3dPtH_BG[0].z_point = zz;
(**w_objs_hndl).bg_object[18]._3dPtH_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[18].z_reg = zz;
(**w_objs_hndl).bg_object[18].max_pts = 1;
(**w_objs_hndl).bg_object[18].alive = TRUE;
GetPoint(&xx,&yy,&zz);
(**w_objs_hndl).bg_object[19]._3dPt_BG[0].x_point = xx; /* fourth calculator */
(**w_objs_hndl).bg_object[19]._3dPt_BG[0].y_point = yy;
(**w_objs_hndl).bg_object[19]._3dPt_BG[0].z_point = zz;
(**w_objs_hndl).bg_object[19]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[19]._3dPtH_BG[0].x_point = xx;
(**w_objs_hndl).bg_object[19]._3dPtH_BG[0].y_point = yy;
(**w_objs_hndl).bg_object[19]._3dPtH_BG[0].z_point = zz;
(**w_objs_hndl).bg_object[19]._3dPtH_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[19].z_reg = zz;
(**w_objs_hndl).bg_object[19].max_pts = 1;
(**w_objs_hndl).bg_object[19].alive = TRUE;
GetPoint(&xx,&yy,&zz);
(**w_objs_hndl).bg_object[20]._3dPt_BG[0].x_point = xx; /* fifth calculator */
(**w_objs_hndl).bg_object[20]._3dPt_BG[0].y_point = yy;
(**w_objs_hndl).bg_object[20]._3dPt_BG[0].z_point = zz;
(**w_objs_hndl).bg_object[20]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[20]._3dPtH_BG[0].x_point = xx;
(**w_objs_hndl).bg_object[20]._3dPtH_BG[0].y_point = yy;
(**w_objs_hndl).bg_object[20]._3dPtH_BG[0].z_point = zz;
(**w_objs_hndl).bg_object[20]._3dPtH_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[20].z_reg = zz;
(**w_objs_hndl).bg_object[20].max_pts = 1;
(**w_objs_hndl).bg_object[20].alive = TRUE;
GetPoint(&xx,&yy,&zz);
(**w_objs_hndl).bg_object[21]._3dPt_BG[0].x_point = xx; /* sixth calculator */
(**w_objs_hndl).bg_object[21]._3dPt_BG[0].y_point = yy;
(**w_objs_hndl).bg_object[21]._3dPt_BG[0].z_point = zz;
(**w_objs_hndl).bg_object[21]._3dPt_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[21]._3dPtH_BG[0].x_point = xx;
(**w_objs_hndl).bg_object[21]._3dPtH_BG[0].y_point = yy;
(**w_objs_hndl).bg_object[21]._3dPtH_BG[0].z_point = zz;
(**w_objs_hndl).bg_object[21]._3dPtH_BG[0].no_point = 1;
(**w_objs_hndl).bg_object[21].z_reg = zz;
(**w_objs_hndl).bg_object[21].max_pts = 1;
(**w_objs_hndl).bg_object[21].alive = TRUE;
}
/****** set vertices for posterity ******/
(**w_objs_hndl).bg_object[0]._3dPtH_BG[0].x_point = 500; /* first tetrahedron */
(**w_objs_hndl).bg_object[0]._3dPtH_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[0]._3dPtH_BG[0].z_point = - 500;
(**w_objs_hndl).bg_object[0]._3dPtH_BG[1].x_point = 540;
(**w_objs_hndl).bg_object[0]._3dPtH_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[0]._3dPtH_BG[1].z_point = -480;
(**w_objs_hndl).bg_object[0]._3dPtH_BG[2].x_point = 560;
(**w_objs_hndl).bg_object[0]._3dPtH_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[0]._3dPtH_BG[2].z_point = -520;
(**w_objs_hndl).bg_object[0]._3dPtH_BG[3].x_point = 530;
(**w_objs_hndl).bg_object[0]._3dPtH_BG[3].y_point = 170;
(**w_objs_hndl).bg_object[0]._3dPtH_BG[3].z_point = -500;
(**w_objs_hndl).bg_object[1]._3dPtH_BG[0].x_point = 580; /* second tetrahedron */
(**w_objs_hndl).bg_object[1]._3dPtH_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[1]._3dPtH_BG[0].z_point = -470;
(**w_objs_hndl).bg_object[1]._3dPtH_BG[1].x_point = 620;
(**w_objs_hndl).bg_object[1]._3dPtH_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[1]._3dPtH_BG[1].z_point = -460;
(**w_objs_hndl).bg_object[1]._3dPtH_BG[2].x_point = 640;
(**w_objs_hndl).bg_object[1]._3dPtH_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[1]._3dPtH_BG[2].z_point = -490;
(**w_objs_hndl).bg_object[1]._3dPtH_BG[3].x_point = 610;
(**w_objs_hndl).bg_object[1]._3dPtH_BG[3].y_point = 170;
(**w_objs_hndl).bg_object[1]._3dPtH_BG[3].z_point = -470;
(**w_objs_hndl).bg_object[2]._3dPtH_BG[0].x_point = 660; /* third tetrahedron */
(**w_objs_hndl).bg_object[2]._3dPtH_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[2]._3dPtH_BG[0].z_point = -440;
(**w_objs_hndl).bg_object[2]._3dPtH_BG[1].x_point = 700;
(**w_objs_hndl).bg_object[2]._3dPtH_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[2]._3dPtH_BG[1].z_point = -420;
(**w_objs_hndl).bg_object[2]._3dPtH_BG[2].x_point = 720;
(**w_objs_hndl).bg_object[2]._3dPtH_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[2]._3dPtH_BG[2].z_point = -460;
(**w_objs_hndl).bg_object[2]._3dPtH_BG[3].x_point = 690;
(**w_objs_hndl).bg_object[2]._3dPtH_BG[3].y_point = 170;
(**w_objs_hndl).bg_object[2]._3dPtH_BG[3].z_point = -440;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[0].x_point = -200; /* first column */
(**w_objs_hndl).bg_object[3]._3dPtH_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[0].z_point = -100;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[1].x_point = -160;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[1].z_point = -100;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[2].x_point = -160;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[2].z_point = -140;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[3].x_point = -200;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[3].y_point = 200;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[3].z_point = -140;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[4].x_point = -200;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[4].y_point = 100;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[4].z_point = -100;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[5].x_point = -160;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[5].y_point = 100;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[5].z_point = -100;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[6].x_point = -160;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[6].y_point = 100;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[6].z_point = -140;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[7].x_point = -200;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[7].y_point = 100;
(**w_objs_hndl).bg_object[3]._3dPtH_BG[7].z_point = -140;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[0].x_point = -100; /* second column */
(**w_objs_hndl).bg_object[4]._3dPtH_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[0].z_point = -80;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[1].x_point = -60;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[1].z_point = -80;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[2].x_point = -60;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[2].z_point = -120;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[3].x_point = -100;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[3].y_point = 200;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[3].z_point = -120;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[4].x_point = -100;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[4].y_point = 100;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[4].z_point = -80;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[5].x_point = -60;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[5].y_point = 130;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[5].z_point = -80;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[6].x_point = -60;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[6].y_point = 130;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[6].z_point = -120;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[7].x_point = -100;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[7].y_point = 100;
(**w_objs_hndl).bg_object[4]._3dPtH_BG[7].z_point = -120;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[0].x_point = 0; /* third column */
(**w_objs_hndl).bg_object[5]._3dPtH_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[0].z_point = -60;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[1].x_point = 40;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[1].z_point = -60;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[2].x_point = 40;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[2].z_point = -100;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[3].x_point = 0;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[3].y_point = 200;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[3].z_point = -100;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[4].x_point = 0;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[4].y_point = 130;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[4].z_point = -60;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[5].x_point = 40;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[5].y_point = 130;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[5].z_point = -60;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[6].x_point = 40;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[6].y_point = 100;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[6].z_point = -100;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[7].x_point = 0;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[7].y_point = 100;
(**w_objs_hndl).bg_object[5]._3dPtH_BG[7].z_point = -100;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[0].x_point = 100; /* first cube */
(**w_objs_hndl).bg_object[6]._3dPtH_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[0].z_point = 120;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[1].x_point = 140;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[1].z_point = 120;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[2].x_point = 140;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[2].z_point = 80;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[3].x_point = 100;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[3].y_point = 200;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[3].z_point = 80;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[4].x_point = 100;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[4].y_point = 160;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[4].z_point = 120;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[5].x_point = 140;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[5].y_point = 150;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[5].z_point = 120;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[6].x_point = 140;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[6].y_point = 160;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[6].z_point = 80;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[7].x_point = 100;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[7].y_point = 170;
(**w_objs_hndl).bg_object[6]._3dPtH_BG[7].z_point = 80;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[0].x_point = 160; /* second cube */
(**w_objs_hndl).bg_object[7]._3dPtH_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[0].z_point = 180;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[1].x_point = 200;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[1].z_point = 180;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[2].x_point = 200;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[2].z_point = 140;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[3].x_point = 160;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[3].y_point = 200;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[3].z_point = 140;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[4].x_point = 160;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[4].y_point = 160;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[4].z_point = 180;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[5].x_point = 200;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[5].y_point = 160;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[5].z_point = 180;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[6].x_point = 200;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[6].y_point = 160;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[6].z_point = 140;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[7].x_point = 160;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[7].y_point = 160;
(**w_objs_hndl).bg_object[7]._3dPtH_BG[7].z_point = 140;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[0].x_point = 200; /* third cube */
(**w_objs_hndl).bg_object[8]._3dPtH_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[0].z_point = -180;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[1].x_point = 280;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[1].z_point = -180;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[2].x_point = 280;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[2].z_point = -240;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[3].x_point = 200;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[3].y_point = 200;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[3].z_point = -240;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[4].x_point = 200;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[4].y_point = 160;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[4].z_point = -180;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[5].x_point = 280;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[5].y_point = 160;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[5].z_point = -180;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[6].x_point = 280;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[6].y_point = 160;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[6].z_point = -240;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[7].x_point = 200;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[7].y_point = 160;
(**w_objs_hndl).bg_object[8]._3dPtH_BG[7].z_point = -240;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[0].x_point = 300; /* fourth cube */
(**w_objs_hndl).bg_object[9]._3dPtH_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[0].z_point = -480;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[1].x_point = 380;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[1].z_point = -480;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[2].x_point = 380;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[2].z_point = -540;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[3].x_point = 300;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[3].y_point = 200;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[3].z_point = -540;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[4].x_point = 300;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[4].y_point = 160;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[4].z_point = -480;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[5].x_point = 380;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[5].y_point = 160;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[5].z_point = -480;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[6].x_point = 380;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[6].y_point = 160;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[6].z_point = -540;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[7].x_point = 300;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[7].y_point = 160;
(**w_objs_hndl).bg_object[9]._3dPtH_BG[7].z_point = -540;
(**w_objs_hndl).bg_object[10]._3dPtH_BG[0].x_point = 490; /* first triangle */
(**w_objs_hndl).bg_object[10]._3dPtH_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[10]._3dPtH_BG[0].z_point = 200;
(**w_objs_hndl).bg_object[10]._3dPtH_BG[1].x_point = 690;
(**w_objs_hndl).bg_object[10]._3dPtH_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[10]._3dPtH_BG[1].z_point = 200;
(**w_objs_hndl).bg_object[10]._3dPtH_BG[2].x_point = 590;
(**w_objs_hndl).bg_object[10]._3dPtH_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[10]._3dPtH_BG[2].z_point = 30;
(**w_objs_hndl).bg_object[11]._3dPtH_BG[0].x_point = 10; /* second triangle */
(**w_objs_hndl).bg_object[11]._3dPtH_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[11]._3dPtH_BG[0].z_point = 200;
(**w_objs_hndl).bg_object[11]._3dPtH_BG[1].x_point = 210;
(**w_objs_hndl).bg_object[11]._3dPtH_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[11]._3dPtH_BG[1].z_point = 200;
(**w_objs_hndl).bg_object[11]._3dPtH_BG[2].x_point = 110;
(**w_objs_hndl).bg_object[11]._3dPtH_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[11]._3dPtH_BG[2].z_point = 30;
(**w_objs_hndl).bg_object[12]._3dPtH_BG[0].x_point = 250; /* third triangle */
(**w_objs_hndl).bg_object[12]._3dPtH_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[12]._3dPtH_BG[0].z_point = 200;
(**w_objs_hndl).bg_object[12]._3dPtH_BG[1].x_point = 450;
(**w_objs_hndl).bg_object[12]._3dPtH_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[12]._3dPtH_BG[1].z_point = 200;
(**w_objs_hndl).bg_object[12]._3dPtH_BG[2].x_point = 350;
(**w_objs_hndl).bg_object[12]._3dPtH_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[12]._3dPtH_BG[2].z_point = 30;
(**w_objs_hndl).bg_object[13]._3dPtH_BG[0].x_point = 490; /* fourth triangle */
(**w_objs_hndl).bg_object[13]._3dPtH_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[13]._3dPtH_BG[0].z_point = -30;
(**w_objs_hndl).bg_object[13]._3dPtH_BG[1].x_point = 690;
(**w_objs_hndl).bg_object[13]._3dPtH_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[13]._3dPtH_BG[1].z_point = -30;
(**w_objs_hndl).bg_object[13]._3dPtH_BG[2].x_point = 590;
(**w_objs_hndl).bg_object[13]._3dPtH_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[13]._3dPtH_BG[2].z_point = -200;
(**w_objs_hndl).bg_object[14]._3dPtH_BG[0].x_point = 10; /* fifth triangle */
(**w_objs_hndl).bg_object[14]._3dPtH_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[14]._3dPtH_BG[0].z_point = -30;
(**w_objs_hndl).bg_object[14]._3dPtH_BG[1].x_point = 210;
(**w_objs_hndl).bg_object[14]._3dPtH_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[14]._3dPtH_BG[1].z_point = -30;
(**w_objs_hndl).bg_object[14]._3dPtH_BG[2].x_point = 110;
(**w_objs_hndl).bg_object[14]._3dPtH_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[14]._3dPtH_BG[2].z_point = -200;
(**w_objs_hndl).bg_object[15]._3dPtH_BG[0].x_point = 250; /* sixth triangle */
(**w_objs_hndl).bg_object[15]._3dPtH_BG[0].y_point = 200;
(**w_objs_hndl).bg_object[15]._3dPtH_BG[0].z_point = -30;
(**w_objs_hndl).bg_object[15]._3dPtH_BG[1].x_point = 450;
(**w_objs_hndl).bg_object[15]._3dPtH_BG[1].y_point = 200;
(**w_objs_hndl).bg_object[15]._3dPtH_BG[1].z_point = -30;
(**w_objs_hndl).bg_object[15]._3dPtH_BG[2].x_point = 350;
(**w_objs_hndl).bg_object[15]._3dPtH_BG[2].y_point = 200;
(**w_objs_hndl).bg_object[15]._3dPtH_BG[2].z_point = -200;
if(type == T_BACKGRND_OBJ) limit = 21;
else limit = 15;
/** initialize rotation history matrix **/
for(m = 0;m <= limit;m++)
{
for(i = 0;i <= 3;i++)
{
for(j = 0;j <= 3;j++)
{
if(i == j)
{
(**w_objs_hndl).bg_object[m].rotHist[i][j].rotElem = 1;
}
else
{
(**w_objs_hndl).bg_object[m].rotHist[i][j].rotElem = 0;
}
}
}
}
}
/************************* Draw the new object *************************/
draw_object(wPtr, n, spec); /* located in calc_update.c */
return;
} /* end of "create_new_object()" */
/*****************************************************************/
/* D E S E L E C T O B J E C T S - unselect or delete selected objects
/*****************************************************************/
/**
This routine will search the list of objects in the window to clear from the
screen and optionally delete from the list any "selected" objects.
**/
void deselect_objects(WindowPtr wPtr,Boolean delete_obj)
{
short n;
WObjsHandle w_objs_hndl;
/********* Search object list for "selected" items. De-select & delete **********/
w_objs_hndl = (WObjsHandle)GetWRefCon(wPtr);
for(n = 0; n < MAX_OBJECTS; n++)
{
if((**w_objs_hndl).object[n].selected)
{
(**w_objs_hndl).object[n].selected = FALSE;
if(delete_obj) (**w_objs_hndl).object[n].type = NO_OBJ;
inval_object(wPtr, n); /* have update routine to re-draw it */
}
}
} /* end of deselect_objects() **/
/*****************************************************************/
/* P O I N T I N O B J E C T - is the specified point within an object?
/*****************************************************************/
/**
This routine searches down the list of objects in the window until it finds
one whose framing rectangle includes the point specified. (typically a
mouse-down point).
Priority (that which will appear to be "in front" of other objects) is given to
more recent objects, with first priority being for points that fall within
the "grow box" of selected items. Second is for points within selected objects
in general, and third is to points within any object. After that, the point is
considered not in an object.
The function returns the index to the object found, and a code value for the
function result: find_code = 0 => no object
= 1 => in a non-selected object
= 2 => in a selected object
= 3 => in a selected object's grow-box
**/
short point_in_object(WObjsHandle w_objs_hndl, Point the_point,short *n)
{
short index, find_code;
short grow_index, select_index, object_index;
Point offset;
Rect grow_rect, object_rect;
objectDescr the_object;
offset = (**w_objs_hndl).scrollAmount;
/****** Search the objects list for growboxes, selected objects & others ******/
grow_index = -1; /* (index = 0 is a valid possible result) */
select_index = -1;
object_index = -1;
for( index = 0; index < MAX_OBJECTS; index++)
{
the_object = (**w_objs_hndl).object[index];
if(the_object.type != NO_OBJ)
{
object_rect = the_object.bounds;
OffsetRect(&object_rect, -offset.h, -offset.v);
if( PtInRect(the_point, &object_rect))
{
object_index = index;
if(the_object.selected)
{
select_index = index;
SetRect(&grow_rect, /* set up grow-box rectangle */
the_object.bounds.right - 5,
the_object.bounds.bottom - 5,
the_object.bounds.right,
the_object.bounds.bottom);
OffsetRect(&grow_rect, -offset.h, -offset.v);
if( PtInRect(the_point,&grow_rect)) grow_index = index;
} /* end of object is selected */
} /* end of point somewhere in object */
} /* end of if(the_object.type != NO_OBJ) */
} /* end of search loop */
find_code = NO_OBJ;
*n = 0;
if (object_index != -1)
{
*n = object_index;
find_code = NON_SELECTED;
}
if(select_index != -1)
{
*n = select_index;
find_code = SELECTED;
}
if(grow_index != -1 )
{
*n = grow_index;
find_code = GROW_BOX;
}
return(find_code);
} /* end of point_in_object() */
/*****************************************************************/
/* D O R U B B E R R E C T - draw the selection rectangle
/*****************************************************************/
Boolean do_rubber_rect(Point old_pt,Rect *rubrband_rect)
{
long dummy;
Point mouse_pt;
PenState pen_state;
Rect old_rect, new_rect;
Boolean drew_rbr_rect = FALSE;
GetPenState (&pen_state);
PenNormal();
PenMode(patXor);
//PenPat((PatPtr)gray);
PenPat(&qd.gray);
while(StillDown())
{
GetMouse (&mouse_pt);
if(drew_rbr_rect) FrameRect(&old_rect);
Pt2Rect(old_pt, mouse_pt, &new_rect);
FrameRect(&new_rect);
drew_rbr_rect = TRUE;
old_rect = new_rect;
Delay(2L, &dummy);
}
if(drew_rbr_rect) FrameRect(&new_rect);
*rubrband_rect = new_rect;
SetPenState (&pen_state);
return(drew_rbr_rect);
} /* end of do_rubber_rect() */
/*****************************************************************/
/* S E L E C T G R O U P - find objects within selection rectangle & set "selected"
/*****************************************************************/
void select_group(WindowPtr wPtr,Rect *selectn_rect)
{
short index;
Point offset;
Rect object_rect, dummy_rect;
WObjsHandle w_objs_hndl;
objectDescr the_object;
/****** Search the window objects list for objects within selectn_rect ******/
w_objs_hndl = (WObjsHandle)GetWRefCon(wPtr);
offset = (**w_objs_hndl).scrollAmount;
for( index = 0; index < MAX_OBJECTS; index++)
{
the_object = (**w_objs_hndl).object[index];
if(the_object.type != NO_OBJ)
{
object_rect = the_object.bounds;
OffsetRect(&object_rect, -offset.h, -offset.v);
if( SectRect(&object_rect, selectn_rect, &dummy_rect) &&
EqualRect(&object_rect, &dummy_rect) )
{
(**w_objs_hndl).object[index].selected = true;
inval_object(wPtr, index);
}
}
}
} /* end of select_group() */
/*****************************************************************/
/* M O V E O B J E C T S - track the mouse as objects move
/*****************************************************************/
/**
This routine will outline the selected objects and track mouse movement
with this outline. When the mouse is let up, the selected objects will
be deleted from their old position and re-drawn in the new position.
It ia assumed that the port and cliiping region have been properly set up
by the calling routine.
**/
void move_objects (WindowPtr wPtr,Point mouse_pt)
{
short n,i,j,k;
short limit;
Point delta;
Rect object_rect;
WObjsHandle w_objs_hndl;
Boolean spec;
double_t transMat[4][4];
double_t rTransMat[4][4];
double_t vector[4];
double_t newVect[4];
spec = FALSE;
w_objs_hndl = (WObjsHandle)GetWRefCon(wPtr);
draw_move_frames(w_objs_hndl, mouse_pt, &delta);
for(i = 0;i <= 3;i++) /* initialize transMat */
{
for(j = 0;j <= 3;j++)
{
if(i == j)
{
transMat[i][j] = 1;
}
else
{
transMat[i][j] = 0;
}
}
}
transMat[0][3] = delta.h;
transMat[1][3] = delta.v;
/***
Go through the list of objects in the window. If an object is "selected", then
remove it from the screen with a call to "inval_object(), then re-position it
with a moved location. Then go draw it.
The 'effective' move value ("net_move") contains the effective amount to
move the objects in the window.
***/
for(n = 0; n < MAX_OBJECTS; n++)
{
if((**w_objs_hndl).object[n].selected)
{
inval_object(wPtr, n);
object_rect = (**w_objs_hndl).object[n].bounds;
OffsetRect(&object_rect, delta.h, delta.v);
(**w_objs_hndl).object[n].bounds = object_rect;
InvalRect(&object_rect);
if((**w_objs_hndl).object[n].type == CUBE_OBJ || (**w_objs_hndl).object[n].type == HOUSE_OBJ)
{
if ( (**w_objs_hndl).object[n].type == HOUSE_OBJ &&
(**w_objs_hndl).object[n].armed == TRUE &&
(**w_objs_hndl).armament_type >= 1
)
{
InvalRect(&(**w_objs_hndl).object[n].mStruct[0].mRect);
InvalRect(&(**w_objs_hndl).object[n].mStruct[1].mRect);
InvalRect(&(**w_objs_hndl).object[n].mStruct[2].mRect);
InvalRect(&(**w_objs_hndl).object[n].mStruct[3].mRect);
InvalRect(&(**w_objs_hndl).object[n].mStruct[4].mRect);
InvalRect(&(**w_objs_hndl).object[n].mStruct[5].mRect);
InvalRect(&(**w_objs_hndl).object[n].mStruct[6].mRect);
InvalRect(&(**w_objs_hndl).object[n].mStruct[7].mRect);
InvalRect(&(**w_objs_hndl).object[n].mStruct[8].mRect);
InvalRect(&(**w_objs_hndl).object[n].mStruct[9].mRect);
InvalRect(&(**w_objs_hndl).object[n].mStruct[10].mRect);
InvalRect(&(**w_objs_hndl).object[n].mStruct[11].mRect);
InvalRect(&(**w_objs_hndl).object[n].mStruct[12].mRect);
InvalRect(&(**w_objs_hndl).object[n].mStruct[13].mRect);
}
for(i = 0;i <= 3;i++) /* initialize rTransMat */
{
for(j = 0;j <= 3;j++)
{
rTransMat[i][j] = 0;
}
}
for(i = 0;i <= 3;i++)
{
for(j = 0;j <= 3;j++)
{
for(k = 0;k <= 3;k++)
{
rTransMat[i][j] += transMat[i][k] * (**w_objs_hndl).object[n].rotHist[k][j].rotElem;
}
}
}
for(i = 0;i <= 3;i++) /* update rotHist */
{
for(j = 0;j <= 3;j++)
{
(**w_objs_hndl).object[n].rotHist[i][j].rotElem = rTransMat[i][j];
}
}
/*********************** update _3dPt[i] ***********************/
switch((**w_objs_hndl).object[n].type)
{
case 4:
limit = 7;
break;
case 5:
if((**w_objs_hndl).object[n].armed == TRUE) limit = 21;
else limit = 17;
break;
}
for(i = 0; i <= limit; i++)
{
vector[0] = (**w_objs_hndl).object[n]._3dPtH[i].x_point;
vector[1] = (**w_objs_hndl).object[n]._3dPtH[i].y_point;
vector[2] = (**w_objs_hndl).object[n]._3dPtH[i].z_point;
vector[3] = 1;
for(j = 0;j<=3;j++)
{
newVect[j] = 0;
}
for(j = 0;j <= 3;j++) /* row of matrix */
{
for(k = 0;k <= 3;k++)
{
newVect[j] += (**w_objs_hndl).object[n].rotHist[j][k].rotElem * vector[k];
}
}
for(j = 0;j<=3;j++)
{
vector[j] = newVect[j];
}
(**w_objs_hndl).object[n]._3dPt[i].x_point = ceil(vector[0]);
(**w_objs_hndl).object[n]._3dPt[i].y_point = ceil(vector[1]);
(**w_objs_hndl).object[n]._3dPt[i].z_point = ceil(vector[2]);
}
/******************* end of update _3dPt[i] ********************/
}
/*do_update(wPtr);*/
draw_object(wPtr, n, spec); /* in calc_update.c */
}
}
return;
} /* end of move_objects() */
/*****************************************************************/
/* G R O W O B J E C T S - track the mouse as objects grow
/*****************************************************************/
/**
This routine is called when the mouse is clicked in the grow-box of a
previously selected object. It tracks the mouse and draws for each selected
object it's new shape based on the current position of the mouse. When the
mouse button is let up, the original objects are erased and then redrawn
in their new size.
This routine assumes that the port has been set up properly prior to call.
**/
void grow_objects(WindowPtr wPtr,Point mouse_pt)
{
short n;
Point upper_left, lowr_right, delta;
Rect object_rect, temp_rect, doc_rect;
WObjsHandle w_objs_hndl;
Boolean spec;
spec = FALSE;
w_objs_hndl = (WObjsHandle)GetWRefCon(wPtr);
draw_grow_frames(w_objs_hndl, mouse_pt, &delta);
/***
Go through the list of objects in the window. If an object is "selected", then
remove it from the screen with a call to "inval_object(), then re-position it
with a moved location. Then go draw it.
The 'effective' move value ("net_move") contains the effective amount to
move the objects in the window.
***/
SetRect(&doc_rect, 0, 0, (**w_objs_hndl).hDocLimit, (**w_objs_hndl).vDocLimit);
for(n = 0; n < MAX_OBJECTS; n++)
{
if((**w_objs_hndl).object[n].selected)
{
inval_object(wPtr, n); /* erase the object from screen */
object_rect = (**w_objs_hndl).object[n].bounds;
SetPt(&upper_left, object_rect.left, object_rect.top);
SetPt(&lowr_right, object_rect.right, object_rect.bottom);
AddPt(delta, &lowr_right); /* delta is the net resultant mouse motion */
Pt2Rect(upper_left, lowr_right, &temp_rect);
if (temp_rect.left < doc_rect.left ) temp_rect.left = doc_rect.left;
if (temp_rect.top < doc_rect.top ) temp_rect.top = doc_rect.top;
if (temp_rect.right > doc_rect.right ) temp_rect.right = doc_rect.right;
if (temp_rect.bottom > doc_rect.bottom) temp_rect.bottom = doc_rect.bottom;
(**w_objs_hndl).object[n].bounds = temp_rect; /* restore the object */
draw_object(wPtr, n, spec); /* located in calc_update.c */
}
}
return;
} /* end of grow_objects() */
/*****************************************************************/
/* D R A W M O V E F R A M E S - draw frames around selected objects for moving
/*****************************************************************/
void draw_move_frames (WObjsHandle w_objs_hndl,Point mouse_pt,Point *net_move)
/* Point *net_move; NOTE: this is a pointer to a point, NOT a point! */
{
short n;
Point old_point, new_point, delta, offset;
Rect object_rect, rgn_b_box, doc_rect;
PenState pen_state;
RgnHandle objs_rgn;
offset = (**w_objs_hndl).scrollAmount;
/***
We are going to move outlines of the selected objects around on the
window while the user drags the mouse, then redraw the objects in their final
position when the mouse is let up. To quickly draw the object outlines
during mouse-dragging, create a "region" holding the frames of all the selected
objects. Then, to draw their frames, we need only do a "FrameRgn()" call, and NOT
have to go thru the entire list looking for selected objects over and over again.
***/
/********* Search object list for "selected" items. Put in a temp region **********/
objs_rgn = NewRgn();
OpenRgn();
for(n = 0; n < MAX_OBJECTS; n++)
{
if((**w_objs_hndl).object[n].selected)
{
object_rect = (**w_objs_hndl).object[n].bounds;
OffsetRect(&object_rect, -offset.h, -offset.v);
FrameRect(&object_rect);
}
}
CloseRgn(objs_rgn);
/********* Track the mouse with a frame of the region **********/
/*** Need to maintain a "net_move" value because the objects won't
necessarily be moved to where the mouse indicates. For example, if
the mouse moves beyond the borders of the document we'll want to
restrain placement of the objects so that they'll all stay within the
document borders.
***/
GetPenState (&pen_state); /** set up pen for eraseable frame... */
PenNormal();
PenMode(patXor);
//PenPat ((PatPtr)gray);
PenPat (&qd.gray);
PenSize(2,2);
FrameRgn(objs_rgn); /* draw initial frame */
/********* While the user is dragging the mouse... **********************/
old_point = mouse_pt;
new_point = mouse_pt;
SetPt(net_move, 0, 0); /* this is the 'effective' frame/mouse motion */
while (StillDown())
{
GetMouse(&new_point);
if( (new_point.h != old_point.h) /* don't bother unless the mouse moved */
|| (new_point.v != old_point.v) )
{
delta = new_point; /* how much did we move since last time? */
SubPt(old_point, &delta);
FrameRgn(objs_rgn); /* erase previous frame (pen mode = XOR) */
OffsetRgn(objs_rgn, delta.h, delta.v); /* move the frame that amount */
/********* Keep the selected-items frame within document boundaries **********/
/*** a) determine document boundary in scrolled coordinates ***/
SetRect(&doc_rect, 0, 0, (**w_objs_hndl).hDocLimit, (**w_objs_hndl).vDocLimit);
OffsetRect(&doc_rect, -offset.h, -offset.v);
/*** b) undo previous OffSetRect on the items-frame if we're out of bounds ***/
rgn_b_box = (**objs_rgn).rgnBBox;
if( (rgn_b_box.top < doc_rect.top )
|| (rgn_b_box.bottom > doc_rect.bottom) )
{
OffsetRgn(objs_rgn, 0, -delta.v);
net_move->v = net_move->v - delta.v;
}
if( (rgn_b_box.left < doc_rect.left )
|| (rgn_b_box.right > doc_rect.right) )
{
OffsetRgn(objs_rgn, -delta.h, 0);
net_move->h = net_move->h - delta.h;
}
/********* Draw the NEW selected-objects frame **********/
FrameRgn(objs_rgn); /* draw the frame in the moved position */
AddPt(delta, net_move); /* accumulate 'net' move */
old_point = new_point; /* set "old" mouse position to current pos */
}
} /* end 'while' */
/********* When the mouse is let up... **********/
FrameRgn(objs_rgn); /* erase the most recent selected-items frame */
DisposeRgn(objs_rgn);
SetPenState(&pen_state);
return;
} /* end of draw_move_frames() */
/*****************************************************************/
/* D R A W G R O W F R A M E S - track the mouse for grow_objects()
/*****************************************************************/
void draw_grow_frames (WObjsHandle w_objs_hndl,Point mouse_pt,Point *net_size)
/* Point *net_size; /* NOTE: this is a pointer to a point, NOT a point! */
{
short n;
Point old_point, new_point, delta;
PenState pen_state;
/***
While the user holds the mouse down, track the mouse position by drawing
frames (around selected objects) that show what size the objects will become.
To track the mouse movement, we keep track of three mouse-points:
- the original point that the mouse was clicked (in the grow-box of one
of the selected objects) "mouse_pt"
- the new point that the mouse has moved to since we last looked at it
"new_pt"
- and the most recent "new_pt", called "old_pt"
At each "new_pt" we draw a frame around each selected object indicating its
new size based on mouse dragging. We also draw a frame around each object
based on "old_pt" and the "patXor" drawing mode causes the previous frame
to go away. Thus, the user sees that he is growing and shrinking the frames
around selected objects as the mouse is dragged.
***/
GetPenState (&pen_state); /** set up pen for eraseable frame... */
PenNormal();
PenMode(patXor);
//PenPat ((PatPtr)gray);
PenPat (&qd.gray);
PenSize(2,2);
SetPt(&delta, 0, 0);
size_frames(w_objs_hndl, delta); /* draw initial frame */
/********* While the user is dragging the mouse... **********************/
old_point = mouse_pt;
new_point = mouse_pt;
SetPt(net_size, 0, 0); /* this is the 'effective' frame/mouse motion */
while (StillDown())
{
GetMouse(&new_point);
if( (new_point.h != old_point.h) /* don't bother unless the mouse moved */
|| (new_point.v != old_point.v) )
{
delta = old_point; /* 'erase' previous frame (redraw it) */
SubPt(mouse_pt, &delta);
size_frames(w_objs_hndl, delta);
delta = new_point; /* draw new, resized frame */
SubPt(mouse_pt, &delta);
size_frames(w_objs_hndl, delta);
old_point = new_point; /* set "old" mouse position to current pos */
}
} /* end 'while' */
/********* When the mouse is let up... **********/
size_frames(w_objs_hndl, delta); /* clear out the frames when leaving... */
*net_size = delta;
SetPenState(&pen_state);
return;
} /* end of draw_grow_frames() */
/*****************************************************************/
/* S I Z E F R A M E S - reshape the frames for draw_size_frames
/*****************************************************************/
void size_frames (WObjsHandle w_objs_hndl,Point delta)
/***
size_frames() assumes that all port and pen characteristics have been
previously set up. Specifically, the port has been selected, clipping set up,
the pen state saved, and the current pen set to mode patXor, size 2 x 2,
and pattern gray.
***/
{
short n;
Point upper_left, lowr_right, offset;
Rect object_rect, temp_rect, doc_rect;
offset = (**w_objs_hndl).scrollAmount;
SetRect(&doc_rect, 0, 0, (**w_objs_hndl).hDocLimit, (**w_objs_hndl).vDocLimit);
OffsetRect(&doc_rect, -offset.h, -offset.v);
for(n = 0; n < MAX_OBJECTS; n++)
{
if((**w_objs_hndl).object[n].selected)
{
object_rect = (**w_objs_hndl).object[n].bounds;
SetPt(&upper_left, object_rect.left - offset.h,
object_rect.top - offset.v);
SetPt(&lowr_right, object_rect.right - offset.h,
object_rect.bottom - offset.v);
AddPt(delta, &lowr_right);
Pt2Rect(upper_left, lowr_right, &temp_rect);
if (temp_rect.left < doc_rect.left ) temp_rect.left = doc_rect.left;
if (temp_rect.top < doc_rect.top ) temp_rect.top = doc_rect.top;
if (temp_rect.right > doc_rect.right ) temp_rect.right = doc_rect.right;
if (temp_rect.bottom > doc_rect.bottom) temp_rect.bottom = doc_rect.bottom;
if( (**w_objs_hndl).object[n].type == CIRCLE_OBJ )
FrameOval(&temp_rect);
else
FrameRect(&temp_rect);
}
}
} /* end of size_frames() */
/*********************** do_rotate_box **************************/
void do_rotate_box(WindowPtr wPtr,EventRecord *an_event)
/* from handlemousedown gets gRotateBox if from */
/* clicking on rotate button in that window */
{
WRObjsHandle wr_objs_hndl;
Point mouse_pt;
long obj_type;
//long charCode;
Boolean fineMove = false;
//charCode = gTheEvent.message & charCodeMask;
if (an_event->modifiers & cmdKey) fineMove = true;
SetPort(wPtr);
wr_objs_hndl = (WRObjs**)GetWRefCon(wPtr);
mouse_pt = an_event->where;
GlobalToLocal( &mouse_pt );
if( PtInRect(mouse_pt, &gRotation_frame) )
{
if(PtInRect(mouse_pt,&gXrotation_box)) obj_type = X_ROTATION_BOX; /* 1 */
else if(PtInRect(mouse_pt,&gYrotation_box)) obj_type = Y_ROTATION_BOX; /* 2 */
else if(PtInRect(mouse_pt,&gZrotation_box)) obj_type = Z_ROTATION_BOX; /* 3 */
else if(PtInRect(mouse_pt,&gNegXrotation_box)) obj_type = NEG_X_ROT_BOX; /* 4 */
else if(PtInRect(mouse_pt,&gNegYrotation_box)) obj_type = NEG_Y_ROT_BOX; /* 5 */
else if(PtInRect(mouse_pt,&gNegZrotation_box)) obj_type = NEG_Z_ROT_BOX; /* 6 */
(**wr_objs_hndl).paletteSetting = obj_type;
do_rotation_subject(wPtr,fineMove); /* in this file */
}
else if(PtInRect(mouse_pt,&gDoManyRotation_box))
{
(**wr_objs_hndl).paletteSetting = DO_MANY_ROT_BOX; /* 12 */
do_rotation_subject(wPtr,fineMove); /* in this file */
}
else if(PtInRect(mouse_pt,&gMovement_frame) )
{
if(PtInRect(mouse_pt,&gDoRotateLeft_box)) obj_type = DO_ROT_LEFT_BOX; /* 13 */
else if(PtInRect(mouse_pt,&gDoRotateRight_box)) obj_type = DO_ROT_RT_BOX; /* 14 */
else if(PtInRect(mouse_pt,&gDoRotateUp_box)) obj_type = DO_ROT_UP_BOX; /* 15 */
else if(PtInRect(mouse_pt,&gDoRotateDown_box)) obj_type = DO_ROT_DN_BOX; /* 16 */
else if(PtInRect(mouse_pt,&gDoMoveIn_box)) obj_type = DO_MOVE_IN_BOX; /* 17 */
else if(PtInRect(mouse_pt,&gDoMoveOut_box)) obj_type = DO_MOVE_OUT_BOX; /* 18 */
(**wr_objs_hndl).paletteSetting = obj_type;
do_rotation_subject(wPtr,fineMove); /* this */
}
else if(PtInRect(mouse_pt,&gPlaneControl_frame) )
{
if(PtInRect(mouse_pt,&gDoPitchUp_box)) obj_type = DO_PITCH_UP_BOX; /* 19 */
else if(PtInRect(mouse_pt,&gDoPitchDn_box)) obj_type = DO_PITCH_DN_BOX; /* 20 */
else if(PtInRect(mouse_pt,&gDoYawLft_box)) obj_type = DO_YAW_LFT_BOX; /* 21 */
else if(PtInRect(mouse_pt,&gDoYawRt_box)) obj_type = DO_YAW_RT_BOX; /* 22 */
else if(PtInRect(mouse_pt,&gDoBankLft_box)) obj_type = DO_BANK_LFT_BOX; /* 23 */
else if(PtInRect(mouse_pt,&gDoBankRt_box)) obj_type = DO_BANK_RT_BOX; /* 24 */
(**wr_objs_hndl).paletteSetting = obj_type;
do_rotation_subject(wPtr,fineMove); /* this */
}
else
{
if(PtInRect(mouse_pt,&gXrot_text_box)) obj_type = X_ROT_TEXT_BOX; /* 7 */
else if(PtInRect(mouse_pt,&gYrot_text_box)) obj_type = Y_ROT_TEXT_BOX; /* 8 */
else if(PtInRect(mouse_pt,&gZrot_text_box)) obj_type = Z_ROT_TEXT_BOX; /* 9 */
else if(PtInRect(mouse_pt,&gRot_OK_box)) obj_type = ROTATION_OK_BOX; /* 10 */
else if(PtInRect(mouse_pt,&gRot_Cancel_box)) obj_type = ROT_CANCEL_BOX; /* 11 */
(**wr_objs_hndl).paletteSetting = obj_type;
do_get_rot_text(wPtr);
}
}
/*********************** do_stretch_box *************************/
void do_stretch_box(WindowPtr wPtr,EventRecord *an_event) /* called from calc_mousedown.c */
{
WSObjsHandle ws_objs_hndl;
Point mouse_pt;
long obj_type;
SetPort(wPtr);
ws_objs_hndl=(WSObjs**)GetWRefCon(wPtr);
mouse_pt = an_event->where;
GlobalToLocal( &mouse_pt );
if( PtInRect(mouse_pt, &gStretch_frame) )
{
if(PtInRect(mouse_pt,&gXstretch_box)) obj_type = X_STRETCH_BOX;
else if(PtInRect(mouse_pt,&gYstretch_box)) obj_type = Y_STRETCH_BOX;
else if(PtInRect(mouse_pt,&gZstretch_box)) obj_type = Z_STRETCH_BOX;
else if(PtInRect(mouse_pt,&gNegXstretch_box)) obj_type = NEG_X_STR_BOX;
else if(PtInRect(mouse_pt,&gNegYstretch_box)) obj_type = NEG_Y_STR_BOX;
else if(PtInRect(mouse_pt,&gNegZstretch_box)) obj_type = NEG_Z_STR_BOX;
(**ws_objs_hndl).paletteSetting = obj_type;
do_stretch_subject(wPtr);
}
else
{
if(PtInRect(mouse_pt,&gXstr_text_box)) obj_type = X_STR_TEXT_BOX;
else if(PtInRect(mouse_pt,&gYstr_text_box)) obj_type = Y_STR_TEXT_BOX;
else if(PtInRect(mouse_pt,&gZstr_text_box)) obj_type = Z_STR_TEXT_BOX;
else if(PtInRect(mouse_pt,&gStr_OK_box)) obj_type = STRETCH_OK_BOX;
else if(PtInRect(mouse_pt,&gStr_Cancel_box)) obj_type = STR_CANCEL_BOX;
(**ws_objs_hndl).paletteSetting = obj_type;
do_get_str_text(wPtr);
}
}
/********************* do_rotation_subject **********************/
void do_rotation_subject(WindowPtr wPtr,Boolean fineMove ) /* gets gRotationBox if rotate button pressed */
{
WRObjsHandle wr_objs_hndl;
long theSetting,dummy;
Handle icon_hndl;
short i,increment;
wr_objs_hndl=(WRObjs**)GetWRefCon(wPtr);
EraseRect(&gRotation_frame);
EraseRect(&gDoManyRotation_box);
EraseRect(&gMovement_frame);
EraseRect(&gPlaneControl_frame);
theSetting = (**wr_objs_hndl).paletteSetting;
if(theSetting == X_ROTATION_BOX) /* 1 */
{
icon_hndl = GetResource('ICON', ROT_X_ID_DOWN);
PlotIcon(&gXrotation_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', ROT_X_ID);
PlotIcon(&gXrotation_box, icon_hndl);
/***************************************************************/
if(theSetting == Y_ROTATION_BOX) /* 2 */
{
icon_hndl = GetResource('ICON', ROT_Y_ID_DOWN);
PlotIcon(&gYrotation_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', ROT_Y_ID);
PlotIcon(&gYrotation_box, icon_hndl);
/***************************************************************/
if(theSetting == Z_ROTATION_BOX) /* 3 */
{
icon_hndl = GetResource('ICON', ROT_Z_ID_DOWN);
PlotIcon(&gZrotation_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', ROT_Z_ID);
PlotIcon(&gZrotation_box, icon_hndl);
/***************************************************************/
if(theSetting == NEG_X_ROT_BOX) /* 4 */
{
icon_hndl = GetResource('ICON', NEG_ROT_X_ID_DN);
PlotIcon(&gNegXrotation_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', NEG_ROT_X_ID);
PlotIcon(&gNegXrotation_box, icon_hndl);
/***************************************************************/
if(theSetting == NEG_Y_ROT_BOX) /* 5 */
{
icon_hndl = GetResource('ICON', NEG_ROT_Y_ID_DN);
PlotIcon(&gNegYrotation_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', NEG_ROT_Y_ID);
PlotIcon(&gNegYrotation_box, icon_hndl);
/***************************************************************/
if(theSetting == NEG_Z_ROT_BOX) /* 6 */
{
icon_hndl = GetResource('ICON', NEG_ROT_Z_ID_DN);
PlotIcon(&gNegZrotation_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', NEG_ROT_Z_ID);
PlotIcon(&gNegZrotation_box, icon_hndl);
/***************************************************************/
if(theSetting == DO_MANY_ROT_BOX) /* 12 */
{
icon_hndl = GetResource('ICON', DO_MANY_ROT_BOX_ID_DN);
PlotIcon(&gDoManyRotation_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', DO_MANY_ROT_BOX_ID);
PlotIcon(&gDoManyRotation_box, icon_hndl);
/***************************************************************/
if(theSetting == DO_ROT_LEFT_BOX) /* 13 */
{
icon_hndl = GetResource('ICON', ROT_LEFT_ID_DN);
PlotIcon(&gDoRotateLeft_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', ROT_LEFT_ID);
PlotIcon(&gDoRotateLeft_box, icon_hndl);
/***************************************************************/
if(theSetting == DO_ROT_RT_BOX) /* 14 */
{
icon_hndl = GetResource('ICON', ROT_RT_ID_DN);
PlotIcon(&gDoRotateRight_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', ROT_RT_ID);
PlotIcon(&gDoRotateRight_box, icon_hndl);
/***************************************************************/
if(theSetting == DO_ROT_UP_BOX) /* 15 */
{
icon_hndl = GetResource('ICON', ROT_UP_ID_DN);
PlotIcon(&gDoRotateUp_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', ROT_UP_ID);
PlotIcon(&gDoRotateUp_box, icon_hndl);
/***************************************************************/
if(theSetting == DO_ROT_DN_BOX) /* 16 */
{
icon_hndl = GetResource('ICON', ROT_DN_ID_DN);
PlotIcon(&gDoRotateDown_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', ROT_DN_ID);
PlotIcon(&gDoRotateDown_box, icon_hndl);
/***************************************************************/
if(theSetting == DO_MOVE_IN_BOX) /* 17 */
{
icon_hndl = GetResource('ICON', MOVE_IN_ID_DN);
PlotIcon(&gDoMoveIn_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', MOVE_IN_ID);
PlotIcon(&gDoMoveIn_box, icon_hndl);
/***************************************************************/
if(theSetting == DO_MOVE_OUT_BOX) /* 18 */
{
icon_hndl = GetResource('ICON', MOVE_OUT_ID_DN);
PlotIcon(&gDoMoveOut_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', MOVE_OUT_ID);
PlotIcon(&gDoMoveOut_box, icon_hndl);
/***************************************************************/
if(theSetting == DO_PITCH_UP_BOX) /* 19 */
{
icon_hndl = GetResource('ICON', PITCH_UP_ID_DN);
PlotIcon(&gDoPitchUp_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', PITCH_UP_ID);
PlotIcon(&gDoPitchUp_box, icon_hndl);
/***************************************************************/
if(theSetting == DO_PITCH_DN_BOX) /* 20 */
{
icon_hndl = GetResource('ICON', PITCH_DN_ID_DN);
PlotIcon(&gDoPitchDn_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', PITCH_DN_ID);
PlotIcon(&gDoPitchDn_box, icon_hndl);
/***************************************************************/
if(theSetting == DO_YAW_LFT_BOX) /* 21 */
{
icon_hndl = GetResource('ICON', YAW_LFT_ID_DN);
PlotIcon(&gDoYawLft_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', YAW_LFT_ID);
PlotIcon(&gDoYawLft_box, icon_hndl);
/***************************************************************/
if(theSetting == DO_YAW_RT_BOX) /* 22 */
{
icon_hndl = GetResource('ICON', YAW_RT_ID_DN);
PlotIcon(&gDoYawRt_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', YAW_RT_ID);
PlotIcon(&gDoYawRt_box, icon_hndl);
/***************************************************************/
if(theSetting == DO_BANK_LFT_BOX) /* 23 */
{
icon_hndl = GetResource('ICON', BANK_LFT_ID_DN);
PlotIcon(&gDoBankLft_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', BANK_LFT_ID);
PlotIcon(&gDoBankLft_box, icon_hndl);
/***************************************************************/
if(theSetting == DO_BANK_RT_BOX) /* 24 */
{
icon_hndl = GetResource('ICON', BANK_RT_ID_DN);
PlotIcon(&gDoBankRt_box, icon_hndl);
Delay(2L, &dummy);
}
icon_hndl = GetResource('ICON', BANK_RT_ID);
PlotIcon(&gDoBankRt_box, icon_hndl);
/***************************************************************/
if(fineMove) increment = 1;
else increment = 5;
/* insert here a call to inval_bg_object() */
/* do wholesale invalidation of background objects */
switch(theSetting)
{
case X_ROTATION_BOX:
Do_Rotate(lastPtr,increment,0,0,FALSE); /* in calc_dork.c */
break;
case Y_ROTATION_BOX:
Do_Rotate(lastPtr,0,increment,0,FALSE);
break;
case Z_ROTATION_BOX:
Do_Rotate(lastPtr,0,0,increment,FALSE);
break;
case NEG_X_ROT_BOX:
Do_Rotate(lastPtr,-increment,0,0,FALSE);
break;
case NEG_Y_ROT_BOX:
Do_Rotate(lastPtr,0,-increment,0,FALSE);
break;
case NEG_Z_ROT_BOX:
Do_Rotate(lastPtr,0,0,-increment,FALSE);
break;
case DO_MANY_ROT_BOX:
for(i = 0;i <= 60;i++)
{
Do_Rotate(lastPtr,increment,0,0,FALSE);
Do_Rotate(lastPtr,0,increment,0,FALSE);
Do_Rotate(lastPtr,0,0,increment,FALSE);
}
break;
case DO_ROT_LEFT_BOX:
Do_Movement(lastPtr,0,increment,0,FALSE); /* in calc_dork.c */
break;
case DO_ROT_RT_BOX:
Do_Movement(lastPtr,0,-increment,0,FALSE); /* in calc_dork.c */
break;
case DO_ROT_UP_BOX:
Do_Movement(lastPtr,increment,0,0,FALSE); /* in calc_dork.c */
break;
case DO_ROT_DN_BOX:
Do_Movement(lastPtr,-increment,0,0,FALSE); /* in calc_dork.c */
break;
case DO_MOVE_IN_BOX:
Do_Translation(lastPtr,0,0,increment * 2000,FALSE); /* in calc_dork.c */
break;
case DO_MOVE_OUT_BOX:
Do_Translation(lastPtr,0,0,-increment * 200,FALSE); /* in calc_dork.c */
break;
case DO_PITCH_UP_BOX:
Do_Plane_Control(lastPtr,increment,0,0,FALSE); /* in calc_dork.c */
break;
case DO_PITCH_DN_BOX:
Do_Plane_Control(lastPtr,-increment,0,0,FALSE); /* in calc_dork.c */
break;
case DO_YAW_LFT_BOX:
Do_Plane_Control(lastPtr,0,increment,0,FALSE); /* in calc_dork.c */
break;
case DO_YAW_RT_BOX:
Do_Plane_Control(lastPtr,0,-increment,0,FALSE); /* in calc_dork.c */
break;
case DO_BANK_LFT_BOX:
Do_Plane_Control(lastPtr,0,0,increment,FALSE); /* in calc_dork.c */
break;
case DO_BANK_RT_BOX:
Do_Plane_Control(lastPtr,0,0,-increment,FALSE); /* in calc_dork.c */
break;
}
(**wr_objs_hndl).paletteSetting = 0;
}
/********************* do_stretch_subject ***********************/
void do_stretch_subject(WindowPtr wPtr )
{
Handle icon_hndl;
EraseRect(&gStretch_frame);
icon_hndl = GetResource('ICON', STR_X_ID);
PlotIcon(&gXstretch_box, icon_hndl);
icon_hndl = GetResource('ICON', STR_Y_ID);
PlotIcon(&gYstretch_box, icon_hndl);
icon_hndl = GetResource('ICON', STR_Z_ID);
PlotIcon(&gZstretch_box, icon_hndl);
}
/********************** do_get_rot_text *************************/
void do_get_rot_text(WindowPtr wPtr)
{
}
/*********************** do_get_str_text ************************/
void do_get_str_text(WindowPtr wPtr)
{
}
/************************** GetPoint ****************************/
void GetPoint(short *xx,double_t *yy,double_t *zz)
{
long xxx,xxxx,xxxxx;
long yyy,yyyy,yyyyy;
long zzz,zzzz,zzzzz;
xxx = Random();
xxxx = xxx * 840;
xxxxx = xxxx/65536;
*xx = xxxxx - 200;
yyy = Random();
yyyy = yyy * 100;
yyyyy = yyyy/65536;
*yy = yyyyy + 100;
zzz = Random();
zzzz = zzz * 720;
zzzzz = zzzz/65536;
*zz = zzzzz - 520;
}